Closed nmacuk closed 1 year ago
Hi,
The expected behavior is that this should work, you are taking the correct steps.
Please add IF NOT EXISTS
to you alter table migration, this is needed to prevent it from error when re-creating after wiping completely.
alter table subscription_records add column IF NOT EXISTS provider_subscription_id character varying;
See also https://github.com/zilverline/sequent/issues/382 for more background and a similar issue.
If this doesn't help please provide:
Closing due to inactivity. Feel free to reopen if above comment did not resolve it.
Hello I have encountered an issue when trying to migrate an empty database to a version with AlterTable migration my
migrations.rb
file looks like thisAnd I had a problem when running migrations on an EMPTY database that looked like that:
I followed documentation when making alter table migration for
subscription_records
the files look like this:subscription_records.sql
subscription_records_6.sql
The workaround I found was:
subscription_records.sql
file by removing theprovider_subscription_id
column.provider_subscription_id
column back to thesubscription_records.sql
file and created a new file calledsubscription_records_6.sql
containing the alter table statement to add the column.However, this workaround involved manual modifications and interrupting the migration process, which was not ideal. I'm concerned if this behavior is expected, and whether it means that once an alter_table migration is added, it becomes impossible to wipe the entire database again.
What is the expected behavior here?