aboutsummaryrefslogtreecommitdiffstats
path: root/schema.sql
blob: 21193226b57257457b42d2a262c4a0fa259f3bd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
drop table if exists users;
create table users (
    id integer primary key autoincrement,
    name string not null,
    password string not null
);

drop table if exists news;
create table news (
    id integer primary key autoincrement,
    title string not null,
    date string default (strftime('%Y-%m-%dT%H:%M:%S','now')),
    content string not null,
    user_id integer,
    FOREIGN KEY(user_id) REFERENCES users(id)
);