Guest User

Untitled

a guest
Jan 28th, 2018
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.43 KB | None | 0 0
  1. Table "public.retailers"
  2. Column | Type | Modifiers | Storage | Stats target | Description
  3. ----------------------+-----------------------------+-------------------------------------+----------+--------------+-------------
  4. id | uuid | not null default uuid_generate_v4() | plain | |
  5. app_id | uuid | not null | plain | |
  6. party_id | uuid | not null | plain | |
  7. code | character varying(255) | not null | extended | |
  8. from_date | date | not null | plain | |
  9. thru_date | date | | plain | |
  10. customer_id | uuid | | plain | |
  11. sub_district_id | uuid | not null | plain | |
  12. sap_state | character varying(255) | | extended | |
  13. sap_state_desc | character varying(255) | | extended | |
  14. created_at | timestamp without time zone | | plain | |
  15. updated_at | timestamp without time zone | | plain | |
  16. state | character varying(255) | | extended | |
  17. sales_org_id | uuid | | plain | |
  18. sub_district_default | boolean | not null default false | plain | |
  19. seq | bigint | | plain | |
  20. Indexes:
  21. "retailers_pkey" PRIMARY KEY, btree (id)
  22. "index_retailers_on_app_id_and_code" UNIQUE, btree (app_id, code)
  23. "index_retailers_on_app_id_and_party_id" UNIQUE, btree (app_id, party_id)
  24. "index_retailers_on_app_id" btree (app_id)
  25. "index_retailers_on_code" btree (code)
  26. "index_retailers_on_customer_id" btree (customer_id)
  27. "index_retailers_on_party_id" btree (party_id)
  28. "index_retailers_on_sales_org_id" btree (sales_org_id)
  29. "index_retailers_on_sap_state" btree (sap_state)
  30. "index_retailers_on_sap_state_desc" btree (sap_state_desc)
  31. "index_retailers_on_seq" btree (seq)
  32. "index_retailers_on_sub_district_id" btree (sub_district_id)
  33. Foreign-key constraints:
  34. "retailers_customer_id_fk" FOREIGN KEY (customer_id) REFERENCES customers(id)
  35. "retailers_party_id_fk" FOREIGN KEY (party_id) REFERENCES parties(id)
  36. "retailers_sales_org_id_fk" FOREIGN KEY (sales_org_id) REFERENCES sales_orgs(id)
  37. "retailers_sub_district_id_fk" FOREIGN KEY (sub_district_id) REFERENCES regions(id)
  38. Referenced by:
  39. TABLE "customer_distrib_report_items" CONSTRAINT "customer_distrib_report_items_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
  40. TABLE "distrib_report_item_backups" CONSTRAINT "distrib_report_item_backups_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
  41. TABLE "distrib_report_items" CONSTRAINT "distrib_report_items_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
  42. TABLE "farmer_groups" CONSTRAINT "farmer_groups_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
  43. TABLE "initial_stocks" CONSTRAINT "initial_stocks_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
  44. TABLE "order_items" CONSTRAINT "order_items_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
  45. TABLE "retailer_sales_orgs" CONSTRAINT "retailer_sales_orgs_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
  46. Triggers:
  47. retailers_trigger AFTER INSERT ON retailers FOR EACH ROW EXECUTE PROCEDURE siaga_retailer_bank_maps_updated()
  48.  
  49.  
  50.  
  51.  
  52. ---------------
  53.  
  54. Table "public.distrib_report_items"
  55. Column | Type | Modifiers | Storage | Stats target | Description
  56. -------------------------+-----------------------------+-------------------------------------+---------+--------------+-------------
  57. id | uuid | not null default uuid_generate_v4() | plain | |
  58. app_id | uuid | not null | plain | |
  59. distrib_report_id | uuid | not null | plain | |
  60. retailer_id | uuid | not null | plain | |
  61. distribution_date | date | not null | plain | |
  62. product_id | uuid | not null | plain | |
  63. qty | double precision | not null | plain | |
  64. prev_balance | double precision | | plain | |
  65. balance | double precision | | plain | |
  66. created_at | timestamp without time zone | | plain | |
  67. updated_at | timestamp without time zone | | plain | |
  68. distrib_report_group_id | uuid | | plain | |
  69. Indexes:
  70. "distrib_report_items_pkey" PRIMARY KEY, btree (id)
  71. "index_distrib_report_items_on_app_id" btree (app_id)
  72. "index_distrib_report_items_on_distrib_report_group_id" btree (distrib_report_group_id)
  73. "index_distrib_report_items_on_distrib_report_id" btree (distrib_report_id)
  74. "index_distrib_report_items_on_distribution_date" btree (distribution_date)
  75. "index_distrib_report_items_on_product_id" btree (product_id)
  76. "index_distrib_report_items_on_retailer_id" btree (retailer_id)
  77. "index_on_distrib_report_items" btree (app_id, distrib_report_id, retailer_id, product_id)
  78. "index_on_distrib_report_items_distrib_report_id" btree (distrib_report_id)
  79. "index_on_distrib_report_items_product_id" btree (product_id)
  80. "index_on_distrib_report_items_retailer_id" btree (retailer_id)
  81. Foreign-key constraints:
  82. "distrib_report_items_distrib_report_id_fk" FOREIGN KEY (distrib_report_id) REFERENCES distrib_reports(id)
  83. "distrib_report_items_product_id_fk" FOREIGN KEY (product_id) REFERENCES products(id)
  84. "distrib_report_items_retailer_id_fk" FOREIGN KEY (retailer_id) REFERENCES retailers(id)
  85.  
  86.  
  87. -----------
  88.  
  89. Table "public.distrib_reports"
  90. Column | Type | Modifiers | Storage | Stats target | Description
  91. -------------------------+-----------------------------+-------------------------------------+----------+--------------+-------------
  92. id | uuid | not null default uuid_generate_v4() | plain | |
  93. app_id | uuid | not null | plain | |
  94. distrib_report_group_id | uuid | | plain | |
  95. number | character varying(255) | not null | extended | |
  96. customer_id | uuid | not null | plain | |
  97. sales_group_id | uuid | not null | plain | |
  98. year | integer | not null | plain | |
  99. month | integer | not null | plain | |
  100. system | boolean | not null default false | plain | |
  101. created_at | timestamp without time zone | | plain | |
  102. updated_at | timestamp without time zone | | plain | |
  103. order_id | uuid | | plain | |
  104. state | character varying(255) | | extended | |
  105. sales_org_id | uuid | | plain | |
  106. reference_code | character varying(255) | | extended | |
  107. initial_stock_id | uuid | | plain | |
  108. distribution_date | date | | plain | |
  109. distrib_reportable_id | uuid | | plain | |
  110. distrib_reportable_type | character varying(255) | | extended | |
  111. seq | bigint | | plain | |
  112. Indexes:
  113. "distrib_reports_pkey" PRIMARY KEY, btree (id)
  114. "index_on_distrib_reports_number" UNIQUE, btree (app_id, number)
  115. "distrib_reports_idx" btree (order_id)
  116. "index_distrib_reports_on_app_id" btree (app_id)
  117. "index_distrib_reports_on_customer_id" btree (customer_id)
  118. "index_distrib_reports_on_distrib_report_group_id" btree (distrib_report_group_id)
  119. "index_distrib_reports_on_distrib_reportable_id" btree (distrib_reportable_id)
  120. "index_distrib_reports_on_distrib_reportable_type" btree (distrib_reportable_type)
  121. "index_distrib_reports_on_initial_stock_id" btree (initial_stock_id)
  122. "index_distrib_reports_on_month" btree (month)
  123. "index_distrib_reports_on_number" btree (number)
  124. "index_distrib_reports_on_sales_group_id" btree (sales_group_id)
  125. "index_distrib_reports_on_sales_org_id" btree (sales_org_id)
  126. "index_distrib_reports_on_seq" btree (seq)
  127. "index_distrib_reports_on_year" btree (year)
  128. "index_on_distrib_reports" btree (app_id, distrib_report_group_id, customer_id, sales_group_id, year, month)
  129. "index_on_distrib_reports_state" btree (state)
  130. Foreign-key constraints:
  131. "distrib_reports_customer_id_fk" FOREIGN KEY (customer_id) REFERENCES customers(id)
  132. "distrib_reports_distrib_report_group_id_fk" FOREIGN KEY (distrib_report_group_id) REFERENCES distrib_report_groups(id)
  133. "distrib_reports_initial_stock_id_fk" FOREIGN KEY (initial_stock_id) REFERENCES initial_stocks(id)
  134. "distrib_reports_sales_group_id_fk" FOREIGN KEY (sales_group_id) REFERENCES sales_groups(id)
  135. "distrib_reports_sales_org_id_fk" FOREIGN KEY (sales_org_id) REFERENCES sales_orgs(id)
  136. Referenced by:
  137. TABLE "distrib_report_items" CONSTRAINT "distrib_report_items_distrib_report_id_fk" FOREIGN KEY (distrib_report_id) REFERENCES distrib_reports(id)
  138.  
  139.  
  140.  
  141. -------------
  142.  
  143. Table "public.distrib_report_groups"
  144. Column | Type | Modifiers | Storage | Stats target | Description
  145. ------------------------------+-----------------------------+-------------------------------------+----------+--------------+-------------
  146. id | uuid | not null default uuid_generate_v4() | plain | |
  147. app_id | uuid | not null | plain | |
  148. distrib_report_group_type_id | uuid | not null | plain | |
  149. number | character varying(255) | not null | extended | |
  150. customer_id | uuid | not null | plain | |
  151. year | integer | not null | plain | |
  152. month | integer | not null | plain | |
  153. system | boolean | not null default false | plain | |
  154. created_at | timestamp without time zone | | plain | |
  155. updated_at | timestamp without time zone | | plain | |
  156. state | character varying(255) | | extended | |
  157. sales_group_id | uuid | | plain | |
  158. sales_org_id | uuid | | plain | |
  159. submitted_date | date | | plain | |
  160. seq | bigint | | plain | |
  161. Indexes:
  162. "distrib_report_groups_pkey" PRIMARY KEY, btree (id)
  163. "index_distrib_report_groups_on_app_id" btree (app_id)
  164. "index_distrib_report_groups_on_customer_id" btree (customer_id)
  165. "index_distrib_report_groups_on_distrib_report_group_type_id" btree (distrib_report_group_type_id)
  166. "index_distrib_report_groups_on_month" btree (month)
  167. "index_distrib_report_groups_on_number" btree (number)
  168. "index_distrib_report_groups_on_sales_group_id" btree (sales_group_id)
  169. "index_distrib_report_groups_on_sales_org_id" btree (sales_org_id)
  170. "index_distrib_report_groups_on_seq" btree (seq)
  171. "index_distrib_report_groups_on_year" btree (year)
  172. Foreign-key constraints:
  173. "distrib_report_groups_customer_id_fk" FOREIGN KEY (customer_id) REFERENCES customers(id)
  174. "distrib_report_groups_distrib_report_group_type_id_fk" FOREIGN KEY (distrib_report_group_type_id) REFERENCES distrib_report_group_types(id)
  175. "distrib_report_groups_sales_group_id_fk" FOREIGN KEY (sales_group_id) REFERENCES sales_groups(id)
  176. "distrib_report_groups_sales_org_id_fk" FOREIGN KEY (sales_org_id) REFERENCES sales_orgs(id)
  177. Referenced by:
  178. 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)
  179. 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