You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Default values in a jsonb column do not migrate correctly
Expected Behavior
When generating a migration, the default value for the jsonb column should be created and migrated in that migration. Subsequent migrations should not migrate this jsonb column default value, because it has already been migrated in a previous migration.
Actual Behavior
When generating a migration, the default value for the jsonb column is created in that migration. Every subsequent migration also attempts to migrate this column default value. This implies the migration is failing to correctly set the default value.
Strangely, the default value for the column appears to be created correctly in the database. Perhaps there is something wrong when checking for equivalence?
Issue description
Default values in a jsonb column do not migrate correctly
Expected Behavior
When generating a migration, the default value for the jsonb column should be created and migrated in that migration. Subsequent migrations should not migrate this jsonb column default value, because it has already been migrated in a previous migration.
Actual Behavior
When generating a migration, the default value for the jsonb column is created in that migration. Every subsequent migration also attempts to migrate this column default value. This implies the migration is failing to correctly set the default value.
Strangely, the default value for the column appears to be created correctly in the database. Perhaps there is something wrong when checking for equivalence?
Steps to reproduce
Create a model with a jsonb column:
Generate a migration:
node typeorm migration:generate ExampleMigration1
Run the migration.
Generate another migration:
node typeorm migration:generate ExampleMigration2
Notice ExampleMigration2 includes the default value migration for the
rules
column ofExample
.My Environment
Additional Context
No response
Relevant Database Driver(s)
Are you willing to resolve this issue by submitting a Pull Request?
No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
The text was updated successfully, but these errors were encountered: