DROP TABLE IF EXISTS coupon_product;

-- DROP SEQUENCE IF EXISTS coupon_product_coupon_product_id_seq;
-- CREATE SEQUENCE coupon_product_coupon_product_id_seq;


CREATE TABLE coupon_product (
  "coupon_product_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
  "coupon_id" int check ("coupon_id" > 0) NOT NULL,
  "product_id" int check ("product_id" > 0) NOT NULL
  -- PRIMARY KEY("coupon_product_id")
);

-- SELECT setval('coupon_product_coupon_product_id_seq', 0, true); -- last inserted id by sample data
