· 6 years ago · Mar 07, 2019, 03:40 AM
1dbSchema = `CREATE TABLE IF NOT EXISTS Users (
2 id integer NOT NULL PRIMARY KEY,
3 login text NOT NULL UNIQUE,
4 password text NOT NULL,
5 email text NOT NULL UNIQUE,
6 first_name text,
7 last_name text
8 );
9
10 CREATE TABLE IF NOT EXISTS Blogs (
11 id integer NOT NULL PRIMARY KEY,
12 user_id integer NOT NULL UNIQUE,
13 blog text ,
14 title text NOT NULL,
15 publish_date date,
16 FOREIGN KEY (user_id) REFERENCES Users(id)
17 );`