-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
39 lines (35 loc) · 964 Bytes
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
drop table if exists entries;
create table entries (
id integer primary key autoincrement,
title text not null,
text text not null,
author integer not null,
score integer,
timestamp datetime
);
drop table if exists users;
create table users (
id integer primary key autoincrement,
username text not null unique,
password text not null,
email text not null,
reputation integer
);
drop table if exists events;
create table events (
id integer primary key autoincrement,
owner integer not null,
title text not null,
description text not null,
date datetime not null
);
drop table if exists votes;
create table votes (
id integer primary key autoincrement,
user_id integer not null,
entry_id integer not null,
upvote bool
);
-- For development purposes, prepopulate the database with a user:
insert into users values (1, "admin", "$2a$11$KTg9hr8lVvePTxm9GkikV.gNw/6Is0to8S7RPSGo3NH43JbidHQky", "luca.masters2@gmail.com", 0);
-- password=secret