-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
fix: pass if table is already removed on upgrade #30017
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,17 +26,19 @@ | |
from alembic import op | ||
|
||
from superset.migrations.shared.constraints import drop_fks_for_table | ||
from superset.migrations.shared.utils import has_table | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "39549add7bfc" | ||
down_revision = "02f4f7811799" | ||
|
||
|
||
def upgrade(): | ||
connection = op.get_bind() | ||
if connection.dialect.name != "sqlite": | ||
drop_fks_for_table("sl_table_columns") | ||
op.drop_table("sl_table_columns") | ||
table_name = "sl_table_columns" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you move this outside the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please do this for all changed migrations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
if has_table(table_name): | ||
drop_fks_for_table(table_name) | ||
op.drop_table(table_name) | ||
|
||
|
||
def downgrade(): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe delete this print? If not, then: