Switch data type

This commit is contained in:
swagg boi 2023-08-24 19:40:24 -04:00
parent f56e996fb1
commit f3edd88ee7
3 changed files with 25 additions and 1 deletions

View file

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

12
migrations/14/down.sql Normal file
View file

@ -0,0 +1,12 @@
ALTER TABLE moderators
ALTER COLUMN moderator_name TYPE VARCHAR( 64),
ALTER COLUMN email_addr TYPE VARCHAR(320);
ALTER TABLE remarks
ALTER COLUMN remark_author TYPE VARCHAR( 64),
ALTER COLUMN remark_body TYPE VARCHAR(4096);
ALTER TABLE threads
ALTER COLUMN thread_author TYPE VARCHAR( 64),
ALTER COLUMN thread_title TYPE VARCHAR( 128),
ALTER COLUMN thread_body TYPE VARCHAR(4096);

12
migrations/14/up.sql Normal file
View file

@ -0,0 +1,12 @@
ALTER TABLE moderators
ALTER COLUMN moderator_name TYPE TEXT,
ALTER COLUMN email_addr TYPE TEXT;
ALTER TABLE remarks
ALTER COLUMN remark_author TYPE TEXT,
ALTER COLUMN remark_body TYPE TEXT;
ALTER TABLE threads
ALTER COLUMN thread_author TYPE TEXT,
ALTER COLUMN thread_title TYPE TEXT,
ALTER COLUMN thread_body TYPE TEXT;