Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*create table stuff */
- create table if not exists category
- (
- id serial not null primary key,
- description varchar(200),
- category_name varchar(40),
- created_at timestamp,
- updated_at time
- );
- create table if not exists article
- (
- id serial not null primary key,
- account_id integer,
- title varchar(200),
- description varchar(500),
- content text,
- created_at timestamp,
- updated_at timestamp,
- constraint fk_account
- foreign key (account_id)
- references account (id)
- );
- create table if not exists article_category
- (
- article_id integer,
- category_id integer,
- constraint fk_article
- foreign key (article_id)
- references article (id),
- constraint fk_category
- foreign key (category_id)
- references category (id)
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement