aboutsummaryrefslogtreecommitdiffstats
path: root/postgres
diff options
context:
space:
mode:
authorGravatar Lucas Lindström <[email protected]>2020-10-06 23:56:47 +0200
committerGravatar Lucas Lindström <[email protected]>2020-10-06 23:56:47 +0200
commite83f445a9b8d2db4523e261759bb73ea83ed54c3 (patch)
tree524e9004a88d99bf4882aa8f3affe915718c814f /postgres
parentAdd missing metricity db url environment variable to CI pipeline script. (diff)
Reduce metricity db setup script and API response to the bare necessities.
Diffstat (limited to 'postgres')
-rw-r--r--postgres/init.sql28
1 files changed, 4 insertions, 24 deletions
diff --git a/postgres/init.sql b/postgres/init.sql
index 45ad440c..922ce1ad 100644
--- a/postgres/init.sql
+++ b/postgres/init.sql
@@ -3,39 +3,19 @@ CREATE DATABASE metricity;
\c metricity;
CREATE TABLE users (
- id varchar(255),
- name varchar(255) not null,
- avatar_hash varchar(255),
- joined_at timestamp not null,
- created_at timestamp not null,
- is_staff boolean not null,
- opt_out boolean default false,
- bot boolean default false,
- is_guild boolean default true,
- is_verified boolean default false,
- public_flags text default '{}',
+ id varchar,
verified_at timestamp,
primary key(id)
);
INSERT INTO users VALUES (
0,
- 'foo',
- 'bar',
- current_timestamp,
- current_timestamp,
- false,
- false,
- false,
- true,
- false,
- '{}',
- NULL
+ current_timestamp
);
CREATE TABLE messages (
- id varchar(255),
- author_id varchar(255) references users(id),
+ id varchar,
+ author_id varchar references users(id),
primary key(id)
);