Advertisement
sergAccount

Untitled

Jan 26th, 2018
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. drop table if exists product_category cascade;
  4. drop SEQUENCE product_category_id_seq;
  5. drop table if exists product cascade;
  6. drop SEQUENCE product_id_seq;
  7.  
  8. CREATE SEQUENCE product_category_id_seq
  9.     START WITH 1
  10.     INCREMENT BY 1
  11.     NO MINVALUE
  12.     NO MAXVALUE
  13.     CACHE 1;
  14.  
  15. CREATE SEQUENCE product_id_seq
  16.     START WITH 1
  17.     INCREMENT BY 1
  18.     NO MINVALUE
  19.     NO MAXVALUE
  20.     CACHE 1;
  21.  
  22.  
  23. CREATE TABLE product_category (
  24.     id bigint NOT NULL DEFAULT nextval('product_category_id_seq'::regclass) ,
  25.     parent_id bigint,
  26.     code varchar(50),
  27.     name character varying(255),
  28.     creation_date timestamp without time zone DEFAULT now() NOT NULL
  29. );
  30.  
  31. CREATE TABLE product (
  32.     id bigint NOT NULL DEFAULT nextval('product_id_seq'::regclass) ,
  33.     category_id bigint,
  34.     code varchar(50),
  35.     name character varying(255),
  36.     creation_date timestamp without time zone DEFAULT now() NOT NULL
  37. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement