remove unique constraint on email to accomodate soft deletes

This commit is contained in:
Cam Otts 2023-06-07 11:05:59 -05:00
parent edef86d06a
commit 85616370fc
No known key found for this signature in database
GPG Key ID: 367B7C7EBD84A8BD
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,3 @@
-- +migrate Up
ALTER TABLE account_requests DROP CONSTRAINT account_requests_email_key;

View File

@ -0,0 +1,15 @@
-- +migrate Up
alter table account_requests rename to account_requests_old;
create table account_requests (
id integer primary key,
token string not null unique,
email string not null,
source_address string not null,
created_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
updated_at datetime not null default(strftime('%Y-%m-%d %H:%M:%f', 'now')),
deleted boolean not null default(false)
);
insert into account_requests select * from account_requests_old;
drop table account_requests_old;