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, '');