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: 20260130_000009_coupons_id_uuid

Database error code: 42804

Database error:
ERROR: foreign key constraint "coupon_property_scope_coupon_id_foreign" cannot be implemented
DETAIL: Key columns "coupon_id" of the referencing table and "id" of the referenced table are of incompatible types: integer and uuid.

DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E42804), message: "foreign key constraint \"coupon_property_scope_coupon_id_foreign\" cannot be implemented", detail: Some("Key columns \"coupon_id\" of the referencing table and \"id\" of the referenced table are of incompatible types: integer and uuid."), hint: None, position: None, where_: Some("SQL statement \"ALTER TABLE \"coupons\" ALTER COLUMN \"id\" TYPE UUID USING gen_random_uuid()\"\nPL/pgSQL function inline_code_block line 12 at SQL statement"), schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("tablecmds.c"), line: Some(10429), routine: Some("ATAddForeignKeyConstraint") }

