forked from wundergraph/wundergraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sql
21 lines (17 loc) · 927 Bytes
/
init.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
create table if not exists Users (
id serial primary key not null,
email text not null,
name text not null,
unique (email)
);
create table if not exists Messages (
id serial primary key not null,
user_id int not null references Users(id),
message text not null
);
insert into Users (email, name) VALUES ('[email protected]','Jens@WunderGraph');
insert into Messages (user_id, message) VALUES ((select id from Users where email = '[email protected]'),'Hey, welcome to the WunderGraph!');
insert into Messages (user_id, message) VALUES ((select id from Users where email = '[email protected]'),'This is WunderGraph!');
insert into Messages (user_id, message) VALUES ((select id from Users where email = '[email protected]'),'WunderGraph!');
alter table Users add column updatedAt timestamptz not null default now();
alter table Users add column lastLogin timestamptz not null default now();