Make email_addr unique

This commit is contained in:
swag 2022-11-19 21:50:23 -05:00
parent e18fab859b
commit f755addae6
3 changed files with 6 additions and 1 deletions

View File

@ -53,7 +53,7 @@ sub startup($self) {
# Finish configuring some things
$self->secrets($self->config->{'secrets'}) || die $@;
$self->pg->migrations->from_dir('migrations')->migrate(9);
$self->pg->migrations->from_dir('migrations')->migrate(10);
if (my $threads_per_page = $self->config->{'threads_per_page'}) {
$self->thread->per_page($threads_per_page)

3
migrations/10/down.sql Normal file
View File

@ -0,0 +1,3 @@
ALTER TABLE moderators
DROP CONSTRAINT moderators_email_addr_key;

2
migrations/10/up.sql Normal file
View File

@ -0,0 +1,2 @@
ALTER TABLE moderators
ADD UNIQUE (email_addr);