dataall
dataall copied to clipboard
Add check in migration scripts to create new tables only if one doesnt already exist
Alembic upgrades can fail/get stuck/overwrite existing tables if we dont add a check to see the existence of table with same name already.
We can add a check like this:
if not has_table('dataset_bucket', engine):
op.create_table(
'dataset_bucket',)
before creating new tables in the migration script upgrade.
Reference: https://github.com/awslabs/aws-dataall/pull/848/files/06edb53d772132ede68201d5d24f9acf731cab98#r1388384179
This is a great idea @anushka-singh, thanks for raising an issue. We will include this pattern in any nwe migration script. And if we have bandwidth we will pick it up for existing scripts