1. 서버 장애 해결

문제발생 : 서버에 올리면 꼭 이렇게

Untitled

Untitled


CREATE TABLE products
(
    product_id   int PRIMARY KEY,
    product_name VARCHAR(20) NOT NULL,
    category     VARCHAR(50) NOT NULL,
    price        bigint      NOT NULL,
    description  VARCHAR(500) DEFAULT NULL,
    created_at   datetime(6) NULL,
    updated_at   datetime(6) NULL
);

DROP TABLE products

CREATE TABLE orders
(
    order_id     int(16) PRIMARY KEY,   # int 형
    email        VARCHAR(50)  NOT NULL,
    address      VARCHAR(200) NOT NULL,
    postcode     VARCHAR(200) NOT NULL,
    order_status VARCHAR(50)  NOT NULL,
    created_at   datetime(6)  NOT NULL,
    updated_at   datetime(6) DEFAULT NULL
);

INSERT INTO products VALUE (1, "moon", "COFFEE_BEAN_PACKAGE",1000,"H",NULL,NULL);

CREATE TABLE order_items
(
    seq        bigint      NOT NULL PRIMARY KEY AUTO_INCREMENT,
    order_id   int NOT NULL,        # int 형
    product_id int NOT NULL,
    category   VARCHAR(50) NOT NULL,
    price      bigint      NOT NULL,
    quantity   int         NOT NULL,
    created_at datetime(6) NULL,
    updated_at datetime(6) NULL,
    INDEX (order_id),
    CONSTRAINT fk_order_items_to_order FOREIGN KEY (order_id) REFERENCES orders (order_id) ON DELETE CASCADE,
    CONSTRAINT fk_order_items_to_product FOREIGN KEY (product_id) REFERENCES products (product_id)
);

해결했다!

2. 아파치 프록시 설정