feat(migrations): Add author columns to tables
Adds columns for author names and emails to both threads and posts. "Users" don't (yet? who knows!) exist as independent entity in Converse, they are simply "inferred" via OIDC providers.
This commit is contained in:
parent
ef5f7af89c
commit
da33786939
2 changed files with 15 additions and 0 deletions
5
migrations/2018-04-08-182319_add_authors/down.sql
Normal file
5
migrations/2018-04-08-182319_add_authors/down.sql
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
ALTER TABLE threads DROP COLUMN author_name;
|
||||||
|
ALTER TABLE threads DROP COLUMN author_email;
|
||||||
|
|
||||||
|
ALTER TABLE posts DROP COLUMN author_name;
|
||||||
|
ALTER TABLE posts DROP COLUMN author_email;
|
10
migrations/2018-04-08-182319_add_authors/up.sql
Normal file
10
migrations/2018-04-08-182319_add_authors/up.sql
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
-- This migration adds an 'author' column to the thread & post table.
|
||||||
|
-- Authors don't currently exist as independent objects in the
|
||||||
|
-- database as most user management is simply delegated to the OIDC
|
||||||
|
-- provider.
|
||||||
|
|
||||||
|
ALTER TABLE threads ADD COLUMN author_name VARCHAR NOT NULL DEFAULT 'anonymous';
|
||||||
|
ALTER TABLE threads ADD COLUMN author_email VARCHAR NOT NULL DEFAULT 'unknown@example.org';
|
||||||
|
|
||||||
|
ALTER TABLE posts ADD COLUMN author_name VARCHAR NOT NULL DEFAULT 'anonymous';
|
||||||
|
ALTER TABLE posts ADD COLUMN author_email VARCHAR NOT NULL DEFAULT 'unknown@example.org';
|
Loading…
Reference in a new issue