abirama62

init_table_mapping_cb_in_to_so_balance

Jun 9th, 2021 (edited)
164
39 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -----<1. INIT TABLE cb_mapping_cbin_so_balance>-----
  2. --DROP SEQUENCE IF EXISTS cb_mapping_cbin_so_balance_seq
  3. CREATE SEQUENCE cb_mapping_cbin_so_balance_seq
  4.     INCREMENT 1
  5.     MINVALUE 1
  6.     MAXVALUE 9223372036854775807
  7.     START 10
  8.     CACHE 1;
  9.  
  10. --DROP TABLE IF EXISTS cb_mapping_cbin_so_balance;
  11. CREATE TABLE cb_mapping_cbin_so_balance (
  12.     mapping_cbin_so_balance_id  bigint NOT NULL DEFAULT nextval('cb_mapping_cbin_so_balance_seq'),
  13.     tenant_id     bigint,
  14.     ou_id     bigint,
  15.     mapping_cbin_so_id  bigint,
  16.     doc_no  character varying(30), --> doc no dari mapping cb in to so
  17.     doc_date  character varying(8), --> doc date dari mapping cb in to so
  18.     ref_id  bigint, --> doc id dari dok CB In Other (dokumen referensi)
  19.     ref_doc_type_id  bigint,
  20.     ref_doc_no  character varying(30),
  21.     ref_doc_date  character varying(8),
  22.     payment_amount  numeric,
  23.     flg_convert  character varying(1),
  24.     version     bigint,
  25.     create_datetime     character varying(14),
  26.     create_user_id     bigint,
  27.     update_datetime     character varying(14),
  28.     update_user_id     bigint,
  29.     CONSTRAINT mapping_cbin_so_balance_pkey PRIMARY KEY (mapping_cbin_so_balance_id)
  30. )
  31. WITH (
  32.     OIDS = FALSE
  33. );
  34.  
  35. CREATE UNIQUE INDEX idx_cb_mapping_cbin_so_balance_01
  36.     ON cb_mapping_cbin_so_balance
  37.     USING btree
  38.     (tenant_id, ou_id, mapping_cbin_so_id, ref_id, ref_doc_type_id);
  39.  
  40.  
  41. -----<2. INIT TABLE cb_mapping_cbin_so_balance_item>-----
  42. --DROP SEQUENCE IF EXISTS cb_mapping_cbin_so_balance_item_seq
  43. CREATE SEQUENCE cb_mapping_cbin_so_balance_item_seq
  44.     INCREMENT 1
  45.     MINVALUE 1
  46.     MAXVALUE 9223372036854775807
  47.     START 10
  48.     CACHE 1;
  49.  
  50. --DROP TABLE IF EXISTS cb_mapping_cbin_so_balance_item;
  51. CREATE TABLE cb_mapping_cbin_so_balance_item (
  52.     mapping_cbin_so_balance_item_id  bigint NOT NULL DEFAULT nextval('cb_mapping_cbin_so_balance_item_seq'),
  53.     mapping_cbin_so_balance_id  bigint,
  54.     tenant_id     bigint,
  55.     so_id   bigint,
  56.     doc_no  character varying(30),
  57.     doc_date  character varying(8),
  58.     amount  numeric,
  59.     salesman_id  bigint,
  60.     customer_id  bigint,
  61.     version     bigint,
  62.     create_datetime     character varying(14),
  63.     create_user_id     bigint,
  64.     update_datetime     character varying(14),
  65.     update_user_id     bigint,
  66.     CONSTRAINT mapping_cbin_so_balance_item_pkey PRIMARY KEY (mapping_cbin_so_balance_item_id)
  67. )
  68. WITH (
  69.     OIDS = FALSE
  70. );
RAW Paste Data