Skip to content

Fix migration conflict, insert_question_with_input_types function rollback fails #783

@AmirAgassi

Description

@AmirAgassi

Description

The make down command fails due to a migration conflict with the insert_question_with_input_types function. Two migrations are trying to manage the same function with different rollback strategies, causing ambiguity during rollback operations.

Problem Details

Conflicting migrations:

  • 20250301000000_add_insert_question_function.sql - Creates original function
  • 20250422000006_update_insert_question_with_input_types_fn.sql - Updates function with new parameters

Conflict: When running make down (goose down-to 0), the rollback fails because:

  • Original migration's Down section: DROP FUNCTION IF EXISTS insert_question_with_input_types;
  • Update migration's Down section: Tries to recreate the old version of the function

Steps to Reproduce

  1. Run make up to apply all migrations
  2. Run make down to rollback migrations
  3. Migration rollback fails due to function conflict

Checklist

Before submitting this ticket, make sure this ticket:

  • Is labelled properly
  • Has the SPUR project assigned to it
  • Has an assigned milestone

And lastly:

  • Once someone picks up this ticket, make sure to assign it.

Metadata

Metadata

Assignees

Labels

backendRelated to the backend of the projectbugSomething isn't working

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions