Commit bcf6cbe2 authored by Timo Stolz's avatar Timo Stolz
Browse files

remove email from user table

parent 8b6fcd0a
No related merge requests found
Showing with 37 additions and 0 deletions
+37 -0
-- Deploy 0814-tenants-and-users:users/remove-email-from-user-table to pg
-- requires: users/users
BEGIN;
\ir ../../defaults.sql
alter table :"id_schema".users
drop constraint unique_email_per_tenant,
drop column email;
COMMIT;
-- Revert 0814-tenants-and-users:users/remove-email-from-user-table from pg
BEGIN;
\ir ../../defaults.sql
alter table :"id_schema".users
add column email citext,
add constraint unique_email_per_tenant unique (email, tenant_id);
update :"id_schema".users set
email = user_email_addresses.email_address,
email_address_id = user_email_addresses.id
from :"id_schema".user_email_addresses
where user_email_addresses.id = users.id;
COMMIT;
......@@ -24,3 +24,4 @@ users/sign-up-with-access-token [users/sign-up-with-access-token@0.1.0 credentia
users/my-account [users/my-account@0.1.0 credentials/credentials] 2022-03-14T15:27:35Z Timo Stolz <timo.stolz@nullachtvierzehn.de> # rework my_account() to use separate credentials
users/validate-username-and-email [users/validate-username-and-email@0.1.0 email-addresses/email-addresses] 2022-03-14T14:55:48Z Timo Stolz <timo.stolz@nullachtvierzehn.de> # validate_username_and_email() should use separate email table
users/remove-credentials-from-user-table [users/users] 2022-03-14T14:40:09Z Timo Stolz <timo.stolz@nullachtvierzehn.de> # remove credentials from user table
users/remove-email-from-user-table [users/users] 2022-03-14T14:48:42Z Timo Stolz <timo.stolz@nullachtvierzehn.de> # remove email from user table
-- Verify 0814-tenants-and-users:users/remove-email-from-user-table on pg
BEGIN;
-- XXX Add verifications here.
ROLLBACK;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment