VvebOIDC/install/sql/pgsql/schema/order/order_shipment.sql

16 lines
616 B
SQL

DROP TABLE IF EXISTS order_shipment;
-- DROP SEQUENCE IF EXISTS order_shipment_order_shipment_id_seq;
-- CREATE SEQUENCE order_shipment_order_shipment_id_seq;
CREATE TABLE order_shipment (
"order_shipment_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
"order_id" int check ("order_id" > 0) NOT NULL,
"shipping_method" varchar(191) NOT NULL,
"tracking_number" varchar(191) NOT NULL,
"created_at" timestamp(0) NOT NULL DEFAULT now()
-- PRIMARY KEY("order_shipment_id")
);
-- SELECT setval('order_shipment_order_shipment_id_seq', 0, true); -- last inserted id by sample data