From f3edd88ee72239e8d351b0092992c2ca3b7ab986 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Thu, 24 Aug 2023 19:40:24 -0400 Subject: [PATCH] Switch data type --- lib/PostText.pm | 2 +- migrations/14/down.sql | 12 ++++++++++++ migrations/14/up.sql | 12 ++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 migrations/14/down.sql create mode 100644 migrations/14/up.sql diff --git a/lib/PostText.pm b/lib/PostText.pm index 35d7719..620e59e 100644 --- a/lib/PostText.pm +++ b/lib/PostText.pm @@ -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) diff --git a/migrations/14/down.sql b/migrations/14/down.sql new file mode 100644 index 0000000..de17310 --- /dev/null +++ b/migrations/14/down.sql @@ -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); diff --git a/migrations/14/up.sql b/migrations/14/up.sql new file mode 100644 index 0000000..4211005 --- /dev/null +++ b/migrations/14/up.sql @@ -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;