Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Table "public.retailers"
- Column | Type | Modifiers | Storage | Stats target | Description
- ----------------------+-----------------------------+-------------------------------------+----------+--------------+-------------
- id | uuid | not null default uuid_generate_v4() | plain | |
- app_id | uuid | not null | plain | |
- party_id | uuid | not null | plain | |
- code | character varying(255) | not null | extended | |
- from_date | date | not null | plain | |
- thru_date | date | | plain | |
- customer_id | uuid | | plain | |
- sub_district_id | uuid | not null | plain | |
- sap_state | character varying(255) | | extended | |
- sap_state_desc | character varying(255) | | extended | |
- created_at | timestamp without time zone | | plain | |
- updated_at | timestamp without time zone | | plain | |
- state | character varying(255) | | extended | |
- sales_org_id | uuid | | plain | |
- sub_district_default | boolean | not null default false | plain | |
- seq | bigint | | plain | |
- Indexes:
- "retailers_pkey" PRIMARY KEY, btree (id)
- "index_retailers_on_app_id_and_code" UNIQUE, btree (app_id, code)
- "index_retailers_on_app_id_and_party_id" UNIQUE, btree (app_id, party_id)
- "index_retailers_on_app_id" btree (app_id)
- "index_retailers_on_code" btree (code)
- "index_retailers_on_customer_id" btree (customer_id)
- "index_retailers_on_party_id" btree (party_id)
- "index_retailers_on_sales_org_id" btree (sales_org_id)
- "index_retailers_on_sap_state" btree (sap_state)
- "index_retailers_on_sap_state_desc" btree (sap_state_desc)
- "index_retailers_on_seq" btree (seq)
- "index_retailers_on_sub_district_id" btree (sub_district_id)
- Foreign-key constraints:
- "retailers_customer_id_fk" FOREIGN KEY (customer_id) REFERENCES customers(id)
- "retailers_party_id_fk" FOREIGN KEY (party_id) REFERENCES parties(id)
- "retailers_sales_org_id_fk" FOREIGN KEY (sales_org_id) REFERENCES sales_orgs(id)
- "retailers_sub_district_id_fk" FOREIGN KEY (sub_district_id) REFERENCES regions(id)
- Referenced by:
- TABLE "customer_distrib_report_items" CONSTRAINT "customer_distrib_report_items_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
- TABLE "distrib_report_item_backups" CONSTRAINT "distrib_report_item_backups_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
- TABLE "distrib_report_items" CONSTRAINT "distrib_report_items_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
- TABLE "farmer_groups" CONSTRAINT "farmer_groups_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
- TABLE "initial_stocks" CONSTRAINT "initial_stocks_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
- TABLE "order_items" CONSTRAINT "order_items_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
- TABLE "retailer_sales_orgs" CONSTRAINT "retailer_sales_orgs_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
- Triggers:
- retailers_trigger AFTER INSERT ON retailers FOR EACH ROW EXECUTE PROCEDURE siaga_retailer_bank_maps_updated()
- ---------------
- Table "public.distrib_report_items"
- Column | Type | Modifiers | Storage | Stats target | Description
- -------------------------+-----------------------------+-------------------------------------+---------+--------------+-------------
- id | uuid | not null default uuid_generate_v4() | plain | |
- app_id | uuid | not null | plain | |
- distrib_report_id | uuid | not null | plain | |
- retailer_id | uuid | not null | plain | |
- distribution_date | date | not null | plain | |
- product_id | uuid | not null | plain | |
- qty | double precision | not null | plain | |
- prev_balance | double precision | | plain | |
- balance | double precision | | plain | |
- created_at | timestamp without time zone | | plain | |
- updated_at | timestamp without time zone | | plain | |
- distrib_report_group_id | uuid | | plain | |
- Indexes:
- "distrib_report_items_pkey" PRIMARY KEY, btree (id)
- "index_distrib_report_items_on_app_id" btree (app_id)
- "index_distrib_report_items_on_distrib_report_group_id" btree (distrib_report_group_id)
- "index_distrib_report_items_on_distrib_report_id" btree (distrib_report_id)
- "index_distrib_report_items_on_distribution_date" btree (distribution_date)
- "index_distrib_report_items_on_product_id" btree (product_id)
- "index_distrib_report_items_on_retailer_id" btree (retailer_id)
- "index_on_distrib_report_items" btree (app_id, distrib_report_id, retailer_id, product_id)
- "index_on_distrib_report_items_distrib_report_id" btree (distrib_report_id)
- "index_on_distrib_report_items_product_id" btree (product_id)
- "index_on_distrib_report_items_retailer_id" btree (retailer_id)
- Foreign-key constraints:
- "distrib_report_items_distrib_report_id_fk" FOREIGN KEY (distrib_report_id) REFERENCES distrib_reports(id)
- "distrib_report_items_product_id_fk" FOREIGN KEY (product_id) REFERENCES products(id)
- "distrib_report_items_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
- -----------
- Table "public.distrib_reports"
- Column | Type | Modifiers | Storage | Stats target | Description
- -------------------------+-----------------------------+-------------------------------------+----------+--------------+-------------
- id | uuid | not null default uuid_generate_v4() | plain | |
- app_id | uuid | not null | plain | |
- distrib_report_group_id | uuid | | plain | |
- number | character varying(255) | not null | extended | |
- customer_id | uuid | not null | plain | |
- sales_group_id | uuid | not null | plain | |
- year | integer | not null | plain | |
- month | integer | not null | plain | |
- system | boolean | not null default false | plain | |
- created_at | timestamp without time zone | | plain | |
- updated_at | timestamp without time zone | | plain | |
- order_id | uuid | | plain | |
- state | character varying(255) | | extended | |
- sales_org_id | uuid | | plain | |
- reference_code | character varying(255) | | extended | |
- initial_stock_id | uuid | | plain | |
- distribution_date | date | | plain | |
- distrib_reportable_id | uuid | | plain | |
- distrib_reportable_type | character varying(255) | | extended | |
- seq | bigint | | plain | |
- Indexes:
- "distrib_reports_pkey" PRIMARY KEY, btree (id)
- "index_on_distrib_reports_number" UNIQUE, btree (app_id, number)
- "distrib_reports_idx" btree (order_id)
- "index_distrib_reports_on_app_id" btree (app_id)
- "index_distrib_reports_on_customer_id" btree (customer_id)
- "index_distrib_reports_on_distrib_report_group_id" btree (distrib_report_group_id)
- "index_distrib_reports_on_distrib_reportable_id" btree (distrib_reportable_id)
- "index_distrib_reports_on_distrib_reportable_type" btree (distrib_reportable_type)
- "index_distrib_reports_on_initial_stock_id" btree (initial_stock_id)
- "index_distrib_reports_on_month" btree (month)
- "index_distrib_reports_on_number" btree (number)
- "index_distrib_reports_on_sales_group_id" btree (sales_group_id)
- "index_distrib_reports_on_sales_org_id" btree (sales_org_id)
- "index_distrib_reports_on_seq" btree (seq)
- "index_distrib_reports_on_year" btree (year)
- "index_on_distrib_reports" btree (app_id, distrib_report_group_id, customer_id, sales_group_id, year, month)
- "index_on_distrib_reports_state" btree (state)
- Foreign-key constraints:
- "distrib_reports_customer_id_fk" FOREIGN KEY (customer_id) REFERENCES customers(id)
- "distrib_reports_distrib_report_group_id_fk" FOREIGN KEY (distrib_report_group_id) REFERENCES distrib_report_groups(id)
- "distrib_reports_initial_stock_id_fk" FOREIGN KEY (initial_stock_id) REFERENCES initial_stocks(id)
- "distrib_reports_sales_group_id_fk" FOREIGN KEY (sales_group_id) REFERENCES sales_groups(id)
- "distrib_reports_sales_org_id_fk" FOREIGN KEY (sales_org_id) REFERENCES sales_orgs(id)
- Referenced by:
- TABLE "distrib_report_items" CONSTRAINT "distrib_report_items_distrib_report_id_fk" FOREIGN KEY (distrib_report_id) REFERENCES distrib_reports(id)
- -------------
- Table "public.distrib_report_groups"
- Column | Type | Modifiers | Storage | Stats target | Description
- ------------------------------+-----------------------------+-------------------------------------+----------+--------------+-------------
- id | uuid | not null default uuid_generate_v4() | plain | |
- app_id | uuid | not null | plain | |
- distrib_report_group_type_id | uuid | not null | plain | |
- number | character varying(255) | not null | extended | |
- customer_id | uuid | not null | plain | |
- year | integer | not null | plain | |
- month | integer | not null | plain | |
- system | boolean | not null default false | plain | |
- created_at | timestamp without time zone | | plain | |
- updated_at | timestamp without time zone | | plain | |
- state | character varying(255) | | extended | |
- sales_group_id | uuid | | plain | |
- sales_org_id | uuid | | plain | |
- submitted_date | date | | plain | |
- seq | bigint | | plain | |
- Indexes:
- "distrib_report_groups_pkey" PRIMARY KEY, btree (id)
- "index_distrib_report_groups_on_app_id" btree (app_id)
- "index_distrib_report_groups_on_customer_id" btree (customer_id)
- "index_distrib_report_groups_on_distrib_report_group_type_id" btree (distrib_report_group_type_id)
- "index_distrib_report_groups_on_month" btree (month)
- "index_distrib_report_groups_on_number" btree (number)
- "index_distrib_report_groups_on_sales_group_id" btree (sales_group_id)
- "index_distrib_report_groups_on_sales_org_id" btree (sales_org_id)
- "index_distrib_report_groups_on_seq" btree (seq)
- "index_distrib_report_groups_on_year" btree (year)
- Foreign-key constraints:
- "distrib_report_groups_customer_id_fk" FOREIGN KEY (customer_id) REFERENCES customers(id)
- "distrib_report_groups_distrib_report_group_type_id_fk" FOREIGN KEY (distrib_report_group_type_id) REFERENCES distrib_report_group_types(id)
- "distrib_report_groups_sales_group_id_fk" FOREIGN KEY (sales_group_id) REFERENCES sales_groups(id)
- "distrib_report_groups_sales_org_id_fk" FOREIGN KEY (sales_org_id) REFERENCES sales_orgs(id)
- Referenced by:
- TABLE "distrib_report_group_orders" CONSTRAINT "distrib_report_group_orders_distrib_report_group_id_fk" FOREIGN KEY (distrib_report_group_id) REFERENCES distrib_report_groups(id)
- TABLE "distrib_reports" CONSTRAINT "distrib_reports_distrib_report_group_id_fk" FOREIGN KEY (distrib_report_group_id) REFERENCES distrib_report_groups(id)
Advertisement
Add Comment
Please, Sign In to add comment