-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql-seed.sql
More file actions
22 lines (20 loc) · 876 Bytes
/
Copy pathsql-seed.sql
File metadata and controls
22 lines (20 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
create table users(
id serial primary key,
name text not null,
login text not null,
password text not null,
date_of_creation timestamp with time zone not null default CURRENT_TIMESTAMP,
is_admin bool not null default false,
is_creator bool not null default false);
create table categories(
id serial primary key,
category_name text not null);
create table news(
id serial primary key,
shorttitle text not null,
date_of_creation timestamp with time zone not null default CURRENT_TIMESTAMP,
creatornews integer not null references users (id) on delete cascade,
category_id integer not null references categories (id) on delete cascade,
content text not null,
photo integer,
publishednews bool not null);