2022-10-20 05:48:41 -05:00
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
#
|
2024-12-31 23:56:42 -06:00
|
|
|
# Copyright (C) 2013 - 2025, The pgAdmin Development Team
|
2022-10-20 05:48:41 -05:00
|
|
|
# This software is released under the PostgreSQL Licence
|
|
|
|
#
|
|
|
|
##########################################################################
|
2019-03-13 08:37:34 -05:00
|
|
|
|
2022-10-20 05:48:41 -05:00
|
|
|
"""
|
2019-03-13 08:37:34 -05:00
|
|
|
|
|
|
|
Revision ID: ec1cac3399c9
|
|
|
|
Revises: b5b87fdfcb30
|
|
|
|
Create Date: 2019-03-07 16:05:28.874203
|
|
|
|
|
|
|
|
"""
|
2022-10-20 05:48:41 -05:00
|
|
|
from alembic import op
|
|
|
|
import sqlalchemy as sa
|
2019-03-13 08:37:34 -05:00
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
|
|
revision = 'ec1cac3399c9'
|
|
|
|
down_revision = 'b5b87fdfcb30'
|
|
|
|
branch_labels = None
|
|
|
|
depends_on = None
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade():
|
2022-10-20 05:48:41 -05:00
|
|
|
op.create_table(
|
|
|
|
'query_history',
|
|
|
|
sa.Column('srno', sa.Integer(), nullable=False),
|
|
|
|
sa.Column('uid', sa.Integer(), nullable=False),
|
|
|
|
sa.Column('sid', sa.Integer(), nullable=False),
|
|
|
|
sa.Column('dbname', sa.String(), nullable=False),
|
|
|
|
sa.Column('query_info', sa.String(), nullable=False),
|
|
|
|
sa.Column('last_updated_flag', sa.String(), nullable=False),
|
2022-11-16 02:31:55 -06:00
|
|
|
sa.ForeignKeyConstraint(['sid'], ['server.id'], ondelete='CASCADE'),
|
|
|
|
sa.ForeignKeyConstraint(['uid'], ['user.id'], ondelete='CASCADE'),
|
2022-10-20 05:48:41 -05:00
|
|
|
sa.PrimaryKeyConstraint('srno', 'uid', 'sid', 'dbname'))
|
2019-03-13 08:37:34 -05:00
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
2020-07-24 01:16:30 -05:00
|
|
|
# pgAdmin only upgrades, downgrade not implemented.
|
2019-03-13 08:37:34 -05:00
|
|
|
pass
|