Implement migration

This commit is contained in:
swagg boi 2022-07-29 22:15:14 -04:00
parent 7eb6d2d37e
commit 7738e9bde2
3 changed files with 12 additions and 0 deletions

View file

@ -34,4 +34,6 @@ get '/view', sub ($c) {
app->secrets(app->config->{'secrets'}) || die $@;
app->pg->migrations->from_dir('migrations')->migrate();
app->start();

View file

@ -0,0 +1 @@
DROP TABLE threads;

View file

@ -0,0 +1,9 @@
CREATE TABLE IF NOT EXISTS threads (
thread_id SERIAL PRIMARY KEY,
thread_date TIMESTAMPTZ DEFAULT now(),
thread_author VARCHAR(64),
thread_title VARCHAR(256),
thread_body VARCHAR(4096),
hidden_status BOOLEAN NOT NULL,
flagged_status BOOLEAN NOT NULL
);