From 3a932d7b0a1e3213cb009c3abfde38bc25593b8a Mon Sep 17 00:00:00 2001 From: Leeingnyo Date: Fri, 24 Dec 2021 22:57:11 +0900 Subject: [PATCH] Add column 'sort_title' to titles, ids table --- migration/sort_title.12.cr | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 migration/sort_title.12.cr diff --git a/migration/sort_title.12.cr b/migration/sort_title.12.cr new file mode 100644 index 0000000..8da828f --- /dev/null +++ b/migration/sort_title.12.cr @@ -0,0 +1,17 @@ +class SortTitle < MG::Base + def up : String + <<-SQL + -- add sort_title column to ids and titles + ALTER TABLE ids ADD COLUMN sort_title TEXT; + ALTER TABLE titles ADD COLUMN sort_title TEXT; + SQL + end + + def down : String + <<-SQL + -- drop sort_title column to ids and titles + ALTER TABLE ids DROP COLUMN sort_title; + ALTER TABLE titles DROP COLUMN sort_title; + SQL + end +end