aboutsummaryrefslogtreecommitdiffstats
path: root/postgres
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2021-03-14 23:49:00 +0100
committerGravatar Numerlor <[email protected]>2021-03-15 00:39:58 +0100
commitf9a5c68a4f5400f6963f0795071110ebdc4eebbc (patch)
treee8534db8528370145a42f3e6340daf6f3de6a8cb /postgres
parentCreate migration for doc package name validator. (diff)
parentDockerfile optimisations (diff)
Merge branch 'main' into doc-validator
Diffstat (limited to 'postgres')
-rw-r--r--postgres/init.sql39
1 files changed, 39 insertions, 0 deletions
diff --git a/postgres/init.sql b/postgres/init.sql
new file mode 100644
index 00000000..740063e7
--- /dev/null
+++ b/postgres/init.sql
@@ -0,0 +1,39 @@
+CREATE DATABASE metricity;
+
+\c metricity;
+
+CREATE TABLE users (
+ id varchar,
+ joined_at timestamp,
+ primary key(id)
+);
+
+INSERT INTO users VALUES (
+ 0,
+ current_timestamp
+);
+
+CREATE TABLE messages (
+ id varchar,
+ author_id varchar references users(id),
+ is_deleted boolean,
+ created_at timestamp,
+ channel_id varchar,
+ primary key(id)
+);
+
+INSERT INTO messages VALUES(
+ 0,
+ 0,
+ false,
+ now(),
+ '267659945086812160'
+);
+
+INSERT INTO messages VALUES(
+ 1,
+ 0,
+ false,
+ now() + INTERVAL '10 minutes,',
+ '1234'
+);