Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate the table DDLs with if not exists or if exists #1434

Open
CaselIT opened this issue Feb 27, 2024 Discussed in #1432 · 1 comment
Open

Generate the table DDLs with if not exists or if exists #1434

CaselIT opened this issue Feb 27, 2024 Discussed in #1432 · 1 comment

Comments

@CaselIT
Copy link
Member

CaselIT commented Feb 27, 2024

Discussed in #1432

Originally posted by shaounak February 27, 2024
Modern data warehouses supports create table if not exists or drop table if exists. Is there a way in alembic to run the migrations using this feature. e.g. in the op.create_table, can we create flag. If the value is set for the flag, then issue CREATE TABLE IF NOT EXISTS else issue the default CREATE TABLE statement.

@shaounak
Copy link

Just if you are wondering how this will be useful, one of the use cases I would like to present is the migration from tools like Liquibase or any other schema migration tools to Alembic. For the existing systems, many of the entities will already be deployed, hence when the first migration is executed in the upgrade scenario, there will no effect in the structural changes as all the statements will be executed as create table if not exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants