Merge pull request 'Fixes #988 Fix email_blocklist schema' (#1016) from block_list-schema into main

Reviewed-on: https://git.joinplu.me/Plume/Plume/pulls/1016
This commit is contained in:
KitaitiMakoto 2022-01-29 16:38:33 +00:00
commit a1045dbce9
6 changed files with 30 additions and 2 deletions

View file

@ -15,6 +15,7 @@
### Fixed ### Fixed
- Add explanation of sign-up step at sign-up page when email sign-up mode - Add explanation of sign-up step at sign-up page when email sign-up mode
- Add NOT NULL constraint to email_blocklist table fields
## [[0.7.1]] - 2022-01-12 ## [[0.7.1]] - 2022-01-12

View file

@ -0,0 +1,4 @@
ALTER TABLE email_blocklist ALTER COLUMN notification_text DROP NOT NULL;
ALTER TABLE email_blocklist ALTER COLUMN notify_user DROP NOT NULL;
ALTER TABLE email_blocklist ALTER COLUMN note DROP NOT NULL;
ALTER TABLE email_blocklist ALTER COLUMN email_address DROP NOT NULL;

View file

@ -0,0 +1,4 @@
ALTER TABLE email_blocklist ALTER COLUMN email_address SET NOT NULL;
ALTER TABLE email_blocklist ALTER COLUMN note SET NOT NULL;
ALTER TABLE email_blocklist ALTER COLUMN notify_user SET NOT NULL;
ALTER TABLE email_blocklist ALTER COLUMN notification_text SET NOT NULL;

View file

@ -0,0 +1,9 @@
CREATE TABLE email_blocklist2(id INTEGER PRIMARY KEY,
email_address TEXT UNIQUE,
note TEXT,
notify_user BOOLEAN DEFAULT FALSE,
notification_text TEXT);
INSERT INTO email_blocklist2 SELECT * FROM email_blocklist;
DROP TABLE email_blocklist;
ALTER TABLE email_blocklist2 RENAME TO email_blocklist;

View file

@ -0,0 +1,9 @@
CREATE TABLE email_blocklist2(id INTEGER PRIMARY KEY,
email_address TEXT UNIQUE NOT NULL,
note TEXT NOT NULL,
notify_user BOOLEAN DEFAULT FALSE NOT NULL,
notification_text TEXT NOT NULL);
INSERT INTO email_blocklist2 SELECT * FROM email_blocklist;
DROP TABLE email_blocklist;
ALTER TABLE email_blocklist2 RENAME TO email_blocklist;

View file

@ -75,9 +75,9 @@ table! {
} }
table! { table! {
email_blocklist(id){ email_blocklist (id) {
id -> Int4, id -> Int4,
email_address -> VarChar, email_address -> Text,
note -> Text, note -> Text,
notify_user -> Bool, notify_user -> Bool,
notification_text -> Text, notification_text -> Text,
@ -316,6 +316,7 @@ allow_tables_to_appear_in_same_query!(
blogs, blogs,
comments, comments,
comment_seers, comment_seers,
email_blocklist,
email_signups, email_signups,
follows, follows,
instances, instances,