Merge pull request #342 from openziti/v0.4.0_account_requests

remove unique constraint on email  to accomodate soft deletes (#338)
This commit is contained in:
Michael Quigley 2023-06-12 14:05:17 -04:00 committed by GitHub
commit ec08ebf16f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;