Advertisement
aadddrr

Untitled

Aug 30th, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE SEQUENCE temp_product_catalog_seq
  2.   INCREMENT 1
  3.   MINVALUE 1
  4.   MAXVALUE 9223372036854775807
  5.   START 10
  6.   CACHE 1;
  7.  
  8. CREATE TABLE m_temp_product_catalog
  9. (
  10.   temp_product_catalog_id bigint NOT NULL DEFAULT nextval('temp_product_catalog_seq'),
  11.   tenant_id bigint, -- reference ke t_tenant
  12.   product_id bigint, -- reference ke m_product
  13.   catalog_id bigint, -- reference ke m_catalog
  14.   product_catalog_code character varying(100), -- dapat berbeda dengan product_code
  15.   flg_lanjut character varying(1), -- N jika product_catalog_code baru, Y jika menimpa product catalog sebelumnya
  16.   catalog_price numeric,
  17.   old_catalog_price numeric, -- diisi dengan harga di catalog sebelumnya apabila product_catalog_code sudah pernah digunakan
  18.   disc_member_percent numeric,
  19.   disc_promo_percent numeric,
  20.   nett_price numeric,
  21.   create_datetime character varying(14),
  22.   create_user_id bigint,
  23.   update_datetime character varying(14),
  24.   update_user_id bigint,
  25.   "version" bigint NOT NULL,
  26.   active character varying(1),
  27.   active_datetime character varying(14),
  28.   non_active_datetime character varying(14),
  29.   CONSTRAINT m_temp_product_catalog_pkey PRIMARY KEY (temp_product_catalog_id)
  30. )
  31. WITH (
  32.   OIDS=FALSE
  33. );
  34.  
  35. CREATE UNIQUE INDEX idx_temp_product_catalog_01
  36.   ON m_temp_product_catalog
  37.   USING btree
  38.   (tenant_id, product_catalog_code);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement