SKhan
11/10/2021, 9:54 AMrolled-back
command and then then the migrate dev
/ migrate reset
again, to no success
The errors I am getting are:
• for `migrate reset`:
Error: P3018
A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: <https://pris.ly/d/migrate-resolve>
Migration name: 20210722071621_updated_enum_activity_type_to_include_invite_and_message
Database error code: 25001
Database error:
ERROR: ALTER TYPE ... ADD cannot be executed from a function or multi-command string
DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState("25001"), message: "ALTER TYPE ... ADD cannot be executed from a function or multi-command string", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("xact.c"), line: Some(3237), routine: Some("PreventTransactionChain") }
• for rolled back
and then `migrate dev`:
Error: P3006
Migration `20210722071621_updated_enum_activity_type_to_include_invite_and_message` failed to apply cleanly to the shadow database.
Error:
db error: ERROR: ALTER TYPE ... ADD cannot be executed from a function or multi-command string
0: sql_migration_connector::flavour::postgres::sql_schema_from_migration_history
at migration-engine/connectors/sql-migration-connector/src/flavour/postgres.rs:373
1: sql_migration_connector::validate_migrations
at migration-engine/connectors/sql-migration-connector/src/lib.rs:317
2: migration_core::api::DevDiagnostic
at migration-engine/core/src/api.rs:89
How to resolve this?SKhan
11/11/2021, 6:59 AM-- AlterEnum
-- This migration adds more than one value to an enum.
-- With PostgreSQL versions 11 and earlier, this is not possible
-- in a single migration. This can be worked around by creating
-- multiple migrations, each migration adding only one value to
-- the enum.
ALTER TYPE "ActivityType" ADD VALUE 'MESSAGE';
ALTER TYPE "ActivityType" ADD VALUE 'INVITE';
Once I moved the second entry to a new migration file, it all worked.Frederik
11/11/2021, 9:06 AMJoël
SKhan
11/11/2021, 9:36 AMFrederik
11/11/2021, 10:28 AMSKhan
11/11/2021, 10:45 AMFrederik
12/08/2021, 2:49 PMFrederik
02/18/2022, 11:56 AM