From 542f81d4f1e8e3b5ab8eae6f085caf81abd403c5 Mon Sep 17 00:00:00 2001 From: Dull Bananas Date: Sat, 11 May 2024 19:37:55 +0000 Subject: [PATCH] fix sql --- .../000000000000000_forbid_diesel_cli/up.sql | 2 +- .../down.sql | 3 ++- .../up.sql | 15 +++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/migrations/000000000000000_forbid_diesel_cli/up.sql b/migrations/000000000000000_forbid_diesel_cli/up.sql index 8186fae28..48e3f4287 100644 --- a/migrations/000000000000000_forbid_diesel_cli/up.sql +++ b/migrations/000000000000000_forbid_diesel_cli/up.sql @@ -1,6 +1,6 @@ DO $$ BEGIN - RAISE NOTICE 'migrations must be managed using lemmy_server instead of diesel CLI'; + RAISE 'migrations must be managed using lemmy_server instead of diesel CLI'; END $$; diff --git a/migrations/2024-04-29-012113_custom_migration_runner/down.sql b/migrations/2024-04-29-012113_custom_migration_runner/down.sql index 702f8b9d3..6ea5a2e22 100644 --- a/migrations/2024-04-29-012113_custom_migration_runner/down.sql +++ b/migrations/2024-04-29-012113_custom_migration_runner/down.sql @@ -1 +1,2 @@ -drop table previously_run_sql; +DROP TABLE previously_run_sql; + diff --git a/migrations/2024-04-29-012113_custom_migration_runner/up.sql b/migrations/2024-04-29-012113_custom_migration_runner/up.sql index 88218627b..61985c2cf 100644 --- a/migrations/2024-04-29-012113_custom_migration_runner/up.sql +++ b/migrations/2024-04-29-012113_custom_migration_runner/up.sql @@ -1,5 +1,12 @@ -drop schema if exists r cascade; --- `content` can't be used as primary key because of size limit -create table previously_run_sql (id boolean primary key, content text); -insert into previously_run_sql (id, content) values (true, ''); +DROP SCHEMA IF EXISTS r CASCADE; + +CREATE TABLE previously_run_sql ( + -- For compatibility with Diesel + id boolean PRIMARY KEY, + -- Too big to be used as primary key + content text NOT NULL +); + +INSERT INTO previously_run_sql (id, content) + VALUES (TRUE, '');