Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0705217

Browse files
committed
Add IF EXISTS clause to DROP VIEW statements in order to prevent errors when non-existing views will be dropped in an Alembic version
1 parent99e1e31 commit0705217

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ cython_debug/
195195
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
196196
# and can be added to the global gitignore or merged into this file. For a more nuclear
197197
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
198-
#.idea/
198+
.idea/
199199

200200
# End of https://www.toptal.com/developers/gitignore/api/python,macos
201201

‎src/databricks/sqlalchemy/dialect/base.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ def visit_drop_table(self, drop, **kw):
154154

155155
returntext+self.preparer.format_table(drop.element)
156156

157+
defvisit_drop_view(self,drop,**kw):
158+
return"\nDROP VIEW IF EXISTS "+self.preparer.format_table(drop.element)
159+
157160

158161
@compiles(ColumnComment,"databricks")
159162
defvisit_column_comment(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp