Skip to content

Commit

Permalink
alembic: Fix quoting of the 100rel column
Browse files Browse the repository at this point in the history
Add quoting around the ps_endpoints 100rel column in the ALTER
statements.  Although alembic doesn't complain when generating
sql statements, postgresql does (rightly so).

Resolves: #274
(cherry picked from commit f843871)
  • Loading branch information
gtjoseph authored and asteriskteam committed Sep 6, 2023
1 parent 21e0065 commit 4acf7a2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def upgrade():
enum = ENUM(*NEW_ENUM, name='pjsip_100rel_values_v2')
enum.create(op.get_bind(), checkfirst=False)

op.execute('ALTER TABLE ps_endpoints ALTER COLUMN 100rel TYPE'
op.execute('ALTER TABLE ps_endpoints ALTER COLUMN "100rel" TYPE'
' pjsip_100rel_values_v2 USING'
' 100rel::text::pjsip_100rel_values_v2')
' "100rel"::text::pjsip_100rel_values_v2')

ENUM(name="pjsip_100rel_values").drop(op.get_bind(), checkfirst=False)

Expand All @@ -50,8 +50,8 @@ def downgrade():
enum = ENUM(*OLD_ENUM, name='pjsip_100rel_values')
enum.create(op.get_bind(), checkfirst=False)

op.execute('ALTER TABLE ps_endpoints ALTER COLUMN 100rel TYPE'
op.execute('ALTER TABLE ps_endpoints ALTER COLUMN "100rel" TYPE'
' pjsip_100rel_values USING'
' 100rel::text::pjsip_100rel_values')
' "100rel"::text::pjsip_100rel_values')

ENUM(name="pjsip_100rel_values_v2").drop(op.get_bind(), checkfirst=False)

0 comments on commit 4acf7a2

Please sign in to comment.