nubooya

Untitled

Dec 3rd, 2021
879
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- public.attendances definition
  2.  
  3. -- Drop table
  4.  
  5. -- DROP TABLE public.attendances;
  6.  
  7. CREATE TABLE public.attendances (
  8.     id uuid NOT NULL,
  9.     user_id uuid NULL,
  10.     attendance_start timestamptz NULL,
  11.     attendance_end timestamptz NULL,
  12.     deleted_at timestamptz NULL,
  13.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  14.     updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  15.     user_info jsonb NULL,
  16.     CONSTRAINT attendances_pkey PRIMARY KEY (id)
  17. );
  18.  
  19.  
  20. -- public.batchs definition
  21.  
  22. -- Drop table
  23.  
  24. -- DROP TABLE public.batchs;
  25.  
  26. CREATE TABLE public.batchs (
  27.     id uuid NOT NULL,
  28.     batch_name varchar(25) NULL,
  29.     batch_isactive bool NULL DEFAULT true,
  30.     batch_delivery_date timestamptz NULL,
  31.     batch_pickup_date timestamptz NULL,
  32.     deleted_at timestamptz NULL,
  33.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  34.     updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  35.     user_info jsonb NULL,
  36.     CONSTRAINT batchs_pkey PRIMARY KEY (id)
  37. );
  38.  
  39.  
  40. -- public.client_product_track definition
  41.  
  42. -- Drop table
  43.  
  44. -- DROP TABLE public.client_product_track;
  45.  
  46. CREATE TABLE public.client_product_track (
  47.     id uuid NOT NULL,
  48.     clinet_product_id uuid NULL,
  49.     times_info jsonb NULL,
  50.     user_info jsonb NULL,
  51.     deleted_at timestamptz NULL,
  52.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  53.     updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  54.     CONSTRAINT client_product_track_pkey PRIMARY KEY (id)
  55. );
  56.  
  57.  
  58. -- public.client_products definition
  59.  
  60. -- Drop table
  61.  
  62. -- DROP TABLE public.client_products;
  63.  
  64. CREATE TABLE public.client_products (
  65.     id uuid NOT NULL,
  66.     client_id uuid NULL,
  67.     product_id uuid NULL,
  68.     product_number jsonb NULL,
  69.     product_info jsonb NULL,
  70.     status_id uuid NULL,
  71.     user_info jsonb NULL,
  72.     deleted_at timestamptz NULL,
  73.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  74.     updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  75.     status_track jsonb NULL,
  76.     product_completed bool NULL DEFAULT false,
  77.     CONSTRAINT client_products_pkey PRIMARY KEY (id)
  78. );
  79.  
  80.  
  81. -- public.client_track definition
  82.  
  83. -- Drop table
  84.  
  85. -- DROP TABLE public.client_track;
  86.  
  87. CREATE TABLE public.client_track (
  88.     id uuid NOT NULL,
  89.     client_id uuid NULL,
  90.     track_info jsonb NULL,
  91.     user_info jsonb NULL,
  92.     CONSTRAINT client_track_pkey PRIMARY KEY (id)
  93. );
  94.  
  95.  
  96. -- public.clients definition
  97.  
  98. -- Drop table
  99.  
  100. -- DROP TABLE public.clients;
  101.  
  102. CREATE TABLE public.clients (
  103.     id uuid NOT NULL,
  104.     client_number varchar(30) NULL,
  105.     client_name varchar(100) NULL,
  106.     client_address jsonb NULL,
  107.     project_id uuid NULL,
  108.     user_info jsonb NULL,
  109.     client_isactive bool NULL DEFAULT true,
  110.     deleted_at timestamptz NULL,
  111.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  112.     updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  113.     client_stage jsonb NULL,
  114.     status_id uuid NULL,
  115.     batch_id uuid NULL,
  116.     client_info jsonb NULL,
  117.     CONSTRAINT clients_pkey PRIMARY KEY (id)
  118. );
  119.  
  120.  
  121. -- public.districts definition
  122.  
  123. -- Drop table
  124.  
  125. -- DROP TABLE public.districts;
  126.  
  127. CREATE TABLE public.districts (
  128.     id uuid NOT NULL,
  129.     district_name varchar(150) NULL,
  130.     district_isactive bool NULL DEFAULT true,
  131.     regency_id uuid NULL,
  132.     deleted_at timestamptz NULL,
  133.     user_info json NULL,
  134.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  135.     updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  136.     CONSTRAINT districts_pkey PRIMARY KEY (id)
  137. );
  138.  
  139.  
  140. -- public.package_items definition
  141.  
  142. -- Drop table
  143.  
  144. -- DROP TABLE public.package_items;
  145.  
  146. CREATE TABLE public.package_items (
  147.     id uuid NOT NULL,
  148.     package_name varchar NULL,
  149.     package_items jsonb NULL,
  150.     project_id uuid NULL,
  151.     user_info jsonb NULL,
  152.     CONSTRAINT package_items_pkey PRIMARY KEY (id)
  153. );
  154.  
  155.  
  156. -- public.products definition
  157.  
  158. -- Drop table
  159.  
  160. -- DROP TABLE public.products;
  161.  
  162. CREATE TABLE public.products (
  163.     id uuid NOT NULL,
  164.     product_name varchar(100) NULL,
  165.     product_info jsonb NULL,
  166.     product_order int4 NULL DEFAULT 0,
  167.     product_isserial bool NULL DEFAULT true,
  168.     product_status jsonb NULL,
  169.     status_id uuid NULL,
  170.     product_isactive bool NULL DEFAULT true,
  171.     user_info jsonb NULL,
  172.     deleted_at timestamptz NULL,
  173.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  174.     updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  175.     product_is_install bool NULL DEFAULT false,
  176.     product_menu_url varchar(150) NULL,
  177.     product_specs text NULL,
  178.     product_code varchar(15) NULL,
  179.     CONSTRAINT products_pkey PRIMARY KEY (id)
  180. );
  181.  
  182.  
  183. -- public.project_products definition
  184.  
  185. -- Drop table
  186.  
  187. -- DROP TABLE public.project_products;
  188.  
  189. CREATE TABLE public.project_products (
  190.     id uuid NOT NULL,
  191.     product_id uuid NULL,
  192.     product_qty int4 NULL DEFAULT 1,
  193.     project_id uuid NULL,
  194.     user_info jsonb NULL,
  195.     deleted_at timestamptz NULL,
  196.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  197.     updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  198.     CONSTRAINT project_products_pkey PRIMARY KEY (id)
  199. );
  200.  
  201.  
  202. -- public.projects definition
  203.  
  204. -- Drop table
  205.  
  206. -- DROP TABLE public.projects;
  207.  
  208. CREATE TABLE public.projects (
  209.     id uuid NOT NULL,
  210.     project_name varchar(35) NULL,
  211.     project_start_date timestamptz NULL,
  212.     project_end_date timestamptz NULL,
  213.     user_info jsonb NULL,
  214.     deleted_at timestamptz NULL,
  215.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  216.     updated_at timestamptz NULL,
  217.     project_code varchar(15) NULL,
  218.     project_quota int4 NULL DEFAULT 0,
  219.     CONSTRAINT projects_pkey PRIMARY KEY (id)
  220. );
  221.  
  222.  
  223. -- public.provinces definition
  224.  
  225. -- Drop table
  226.  
  227. -- DROP TABLE public.provinces;
  228.  
  229. CREATE TABLE public.provinces (
  230.     id uuid NOT NULL,
  231.     province_name varchar(50) NOT NULL,
  232.     province_isactive bool NULL DEFAULT true,
  233.     province_timezone varchar(20) NULL,
  234.     province_utc varchar(6) NULL,
  235.     province_iso varchar(5) NULL,
  236.     deleted_at timestamptz NULL,
  237.     user_info json NULL,
  238.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  239.     updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  240.     CONSTRAINT provinces_pkey PRIMARY KEY (id)
  241. );
  242.  
  243.  
  244. -- public.regencies definition
  245.  
  246. -- Drop table
  247.  
  248. -- DROP TABLE public.regencies;
  249.  
  250. CREATE TABLE public.regencies (
  251.     id uuid NOT NULL,
  252.     regency_name varchar(100) NULL,
  253.     regency_isactive bool NULL DEFAULT true,
  254.     province_id uuid NULL,
  255.     deleted_at timestamptz NULL,
  256.     user_info json NULL,
  257.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  258.     updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  259.     CONSTRAINT regencies_pkey PRIMARY KEY (id)
  260. );
  261.  
  262.  
  263. -- public.status definition
  264.  
  265. -- Drop table
  266.  
  267. -- DROP TABLE public.status;
  268.  
  269. CREATE TABLE public.status (
  270.     id uuid NOT NULL,
  271.     status_name varchar(20) NULL,
  272.     status_order int4 NULL DEFAULT 0,
  273.     project_id uuid NULL,
  274.     user_info jsonb NULL,
  275.     deleted_at timestamptz NULL,
  276.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  277.     updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  278.     status_next uuid NULL,
  279.     status_completed bool NULL DEFAULT false,
  280.     status_code varchar(15) NULL,
  281.     status_group varchar(1) NULL,
  282.     client_stage varchar(1) NULL,
  283.     status_icon varchar(150) NULL,
  284.     status_color varchar(15) NULL,
  285.     CONSTRAINT status_pkey PRIMARY KEY (id)
  286. );
  287.  
  288.  
  289. -- public.sys_layout definition
  290.  
  291. -- Drop table
  292.  
  293. -- DROP TABLE public.sys_layout;
  294.  
  295. CREATE TABLE public.sys_layout (
  296.     id int4 NOT NULL,
  297.     organization varchar(50) NULL,
  298.     "name" varchar(150) NULL,
  299.     "data" jsonb NULL,
  300.     notes text NULL,
  301.     created_at timestamptz NULL,
  302.     updated_at timestamptz NULL,
  303.     CONSTRAINT sys_layout_pkey PRIMARY KEY (id)
  304. );
  305.  
  306.  
  307. -- public.sys_menu definition
  308.  
  309. -- Drop table
  310.  
  311. -- DROP TABLE public.sys_menu;
  312.  
  313. CREATE TABLE public.sys_menu (
  314.     code varchar(90) NOT NULL,
  315.     "name" varchar(50) NULL,
  316.     seqno int4 NULL,
  317.     parent varchar(50) NULL,
  318.     link varchar(90) NULL,
  319.     notes varchar(100) NULL,
  320.     created_at timestamptz NULL,
  321.     updated_at timestamptz NULL,
  322.     CONSTRAINT sys_menu_pkey PRIMARY KEY (code)
  323. );
  324.  
  325.  
  326. -- public.sys_role definition
  327.  
  328. -- Drop table
  329.  
  330. -- DROP TABLE public.sys_role;
  331.  
  332. CREATE TABLE public.sys_role (
  333.     id uuid NOT NULL,
  334.     role_name varchar(50) NULL,
  335.     role_notes varchar(250) NULL,
  336.     role_first_url varchar(200) NULL,
  337.     role_isactive bool NULL DEFAULT true,
  338.     menus jsonb NULL,
  339.     created_at timestamptz NULL,
  340.     updated_at timestamptz NULL,
  341.     deleted_at timestamptz NULL,
  342.     CONSTRAINT sys_role_pkey PRIMARY KEY (id)
  343. );
  344.  
  345.  
  346. -- public.sys_token definition
  347.  
  348. -- Drop table
  349.  
  350. -- DROP TABLE public.sys_token;
  351.  
  352. CREATE TABLE public.sys_token (
  353.     id uuid NOT NULL,
  354.     access_token varchar(500) NULL,
  355.     refresh_token varchar(500) NULL,
  356.     expired_at timestamptz NULL,
  357.     client varchar(90) NULL,
  358.     username varchar(50) NULL,
  359.     revoked_at timestamptz NULL,
  360.     user_id uuid NULL,
  361.     created_at timestamptz NULL,
  362.     updated_at timestamptz NULL,
  363.     revoked int4 NULL DEFAULT 0,
  364.     CONSTRAINT sys_token_pkey PRIMARY KEY (id)
  365. );
  366.  
  367.  
  368. -- public.sys_user_role definition
  369.  
  370. -- Drop table
  371.  
  372. -- DROP TABLE public.sys_user_role;
  373.  
  374. CREATE TABLE public.sys_user_role (
  375.     id uuid NOT NULL,
  376.     role_id uuid NULL,
  377.     user_id uuid NULL,
  378.     created_at timestamptz NULL,
  379.     updated_at timestamptz NULL,
  380.     CONSTRAINT sys_user_role_pkey PRIMARY KEY (id)
  381. );
  382.  
  383.  
  384. -- public.sys_users definition
  385.  
  386. -- Drop table
  387.  
  388. -- DROP TABLE public.sys_users;
  389.  
  390. CREATE TABLE public.sys_users (
  391.     id uuid NOT NULL,
  392.     username varchar(50) NULL,
  393.     fullname varchar(150) NULL,
  394.     gender varchar(1) NULL,
  395.     email varchar(50) NULL,
  396.     "password" varchar(100) NULL,
  397.     isactive bool NULL DEFAULT true,
  398.     verified bool NULL DEFAULT false,
  399.     created_at timestamptz NULL,
  400.     updated_at timestamptz NULL,
  401.     deleted_at timestamptz NULL,
  402.     CONSTRAINT sys_users_pkey PRIMARY KEY (id)
  403. );
  404.  
  405.  
  406. -- public.tmp_clients definition
  407.  
  408. -- Drop table
  409.  
  410. -- DROP TABLE public.tmp_clients;
  411.  
  412. CREATE TABLE public.tmp_clients (
  413.     kode varchar(20) NOT NULL,
  414.     nama varchar(100) NULL,
  415.     pic varchar(50) NULL,
  416.     pic_tlp varchar(15) NULL,
  417.     alamat varchar(200) NULL,
  418.     village_id varchar(36) NULL,
  419.     phone varchar(15) NULL,
  420.     created_at timestamptz NULL,
  421.     updated_at timestamptz NULL,
  422.     deleted_at timestamptz NULL,
  423.     project_id uuid NULL,
  424.     CONSTRAINT tmp_client_pkey PRIMARY KEY (kode)
  425. );
  426.  
  427.  
  428. -- public.villages definition
  429.  
  430. -- Drop table
  431.  
  432. -- DROP TABLE public.villages;
  433.  
  434. CREATE TABLE public.villages (
  435.     id uuid NOT NULL,
  436.     village_name varchar(150) NULL,
  437.     district_id uuid NULL,
  438.     village_latitud varchar(10) NULL,
  439.     village_longitud varchar(10) NULL,
  440.     village_utc varchar(10) NULL,
  441.     village_geotag varchar(10) NULL,
  442.     village_postal_code varchar(5) NULL,
  443.     village_timezone varchar(20) NULL,
  444.     deleted_at timestamptz NULL,
  445.     user_info json NULL,
  446.     created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  447.     updated_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
  448.     CONSTRAINT villages_pkey PRIMARY KEY (id)
  449. );
RAW Paste Data