Skip to content

Instantly share code, notes, and snippets.

@ThiefMaster

ThiefMaster/.py Secret

Created May 17, 2019 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThiefMaster/73c07f76d3f8e4d199ad049e7f2b8ced to your computer and use it in GitHub Desktop.
Save ThiefMaster/73c07f76d3f8e4d199ad049e7f2b8ced to your computer and use it in GitHub Desktop.
def upgrade():
op.execute('''
ALTER TABLE events.logs
ALTER COLUMN "data" TYPE jsonb USING replace("data"::text, '\\u0000', '')::jsonb;
''')
def downgrade():
op.execute('''
ALTER TABLE events.logs
ALTER COLUMN "data" TYPE json;
''')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment