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

feat: add header tooltip #7497

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: handle dbs that don't require text length
khtruong committed May 7, 2019
commit 52c8395c641ca62f434e711acaece3e0a6397442
Original file line number Diff line number Diff line change
@@ -29,22 +29,33 @@
revision = 'afc69274c25a'
down_revision = 'e9df189e5c7e'

text_len = 2 ** 32 - 1


def upgrade():
with op.batch_alter_table('query') as batch_op:
batch_op.alter_column(
'sql', existing_type=sa.Text, type_=sa.Text(2 ** 32 - 1))
batch_op.alter_column(
'select_sql', existing_type=sa.Text, type_=sa.Text(2 ** 32 - 1))
batch_op.alter_column(
'executed_sql', existing_type=sa.Text, type_=sa.Text(2 ** 32 - 1))
try:
# Set text length if database accepts it
with op.batch_alter_table('query') as batch_op:
batch_op.alter_column(
'sql', existing_type=sa.Text, type_=sa.Text(length=text_len))
batch_op.alter_column(
'select_sql', existing_type=sa.Text, type_=sa.Text(length=text_len))
batch_op.alter_column(
'executed_sql', existing_type=sa.Text, type_=sa.Text(length=text_len))
except:
# Many databases do not have a length on text objects
# so skip altering for those databases
pass


def downgrade():
with op.batch_alter_table('query') as batch_op:
batch_op.alter_column(
'sql', existing_type=sa.Text(2 ** 32 - 1), type_=sa.Text)
batch_op.alter_column(
'select_sql', existing_type=sa.Text(2 ** 32 - 1), type_=sa.Text)
batch_op.alter_column(
'executed_sql', existing_type=sa.Text(2 ** 32 - 1), type_=sa.Text)
try:
with op.batch_alter_table('query') as batch_op:
batch_op.alter_column(
'sql', existing_type=sa.Text(length=text_len), type_=sa.Text)
batch_op.alter_column(
'select_sql', existing_type=sa.Text(length=text_len), type_=sa.Text)
batch_op.alter_column(
'executed_sql', existing_type=sa.Text(length=text_len), type_=sa.Text)
except:
pass