"""Initial migration

Revision ID: 5f31ff8814e7
Revises:
Create Date: 2022-04-30 19:39:20.164043+00:00

"""
# pylint: disable=no-member, invalid-name, missing-function-docstring, unused-import

import sqlalchemy as sa
import sqlalchemy_utils
import sqlmodel

from alembic import op

# revision identifiers, used by Alembic.
revision = "5f31ff8814e7"
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "database",
        sa.Column("name", sa.String(), nullable=True),
        sa.Column("created_at", sa.DateTime(timezone=True), nullable=True),
        sa.Column("updated_at", sa.DateTime(timezone=True), nullable=True),
        sa.Column("id", sa.Integer(), nullable=True),
        sa.Column("description", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("URI", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("read_only", sa.Boolean(), nullable=True),
        sa.Column("async", sa.Boolean(), nullable=True),
        sa.Column("cost", sa.Float(), nullable=True),
        sa.PrimaryKeyConstraint("id"),
        sa.UniqueConstraint("name"),
    )
    op.create_index(op.f("ix_database_URI"), "database", ["URI"], unique=False)
    op.create_index(op.f("ix_database_async"), "database", ["async"], unique=False)
    op.create_index(op.f("ix_database_cost"), "database", ["cost"], unique=False)
    op.create_index(
        op.f("ix_database_description"),
        "database",
        ["description"],
        unique=False,
    )
    op.create_index(op.f("ix_database_id"), "database", ["id"], unique=False)
    op.create_index(
        op.f("ix_database_read_only"),
        "database",
        ["read_only"],
        unique=False,
    )
    op.create_table(
        "node",
        sa.Column("name", sa.String(), nullable=True),
        sa.Column("created_at", sa.DateTime(timezone=True), nullable=True),
        sa.Column("updated_at", sa.DateTime(timezone=True), nullable=True),
        sa.Column(
            "type",
            sa.Enum("SOURCE", "TRANSFORM", "METRIC", "DIMENSION", name="nodetype"),
            nullable=True,
        ),
        sa.Column("id", sa.Integer(), nullable=True),
        sa.Column("description", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("expression", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.PrimaryKeyConstraint("id"),
        sa.UniqueConstraint("name"),
    )
    op.create_index(op.f("ix_node_description"), "node", ["description"], unique=False)
    op.create_index(op.f("ix_node_expression"), "node", ["expression"], unique=False)
    op.create_index(op.f("ix_node_id"), "node", ["id"], unique=False)
    op.create_table(
        "column",
        sa.Column(
            "type",
            sa.Enum(
                "BYTES",
                "STR",
                "FLOAT",
                "INT",
                "DECIMAL",
                "BOOL",
                "DATETIME",
                "DATE",
                "TIME",
                "TIMEDELTA",
                "LIST",
                "DICT",
                name="columntype",
            ),
            nullable=True,
        ),
        sa.Column("id", sa.Integer(), nullable=True),
        sa.Column("name", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("dimension_id", sa.Integer(), nullable=True),
        sa.Column(
            "dimension_column",
            sqlmodel.sql.sqltypes.AutoString(),
            nullable=True,
        ),
        sa.ForeignKeyConstraint(
            ["dimension_id"],
            ["node.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_index(
        op.f("ix_column_dimension_column"),
        "column",
        ["dimension_column"],
        unique=False,
    )
    op.create_index(
        op.f("ix_column_dimension_id"),
        "column",
        ["dimension_id"],
        unique=False,
    )
    op.create_index(op.f("ix_column_id"), "column", ["id"], unique=False)
    op.create_index(op.f("ix_column_name"), "column", ["name"], unique=False)
    op.create_table(
        "noderelationship",
        sa.Column("parent_id", sa.Integer(), nullable=True),
        sa.Column("child_id", sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ["child_id"],
            ["node.id"],
        ),
        sa.ForeignKeyConstraint(
            ["parent_id"],
            ["node.id"],
        ),
        sa.PrimaryKeyConstraint("parent_id", "child_id"),
    )
    op.create_index(
        op.f("ix_noderelationship_child_id"),
        "noderelationship",
        ["child_id"],
        unique=False,
    )
    op.create_index(
        op.f("ix_noderelationship_parent_id"),
        "noderelationship",
        ["parent_id"],
        unique=False,
    )
    op.create_table(
        "query",
        sa.Column("id", sqlalchemy_utils.types.uuid.UUIDType(), nullable=False),
        sa.Column("database_id", sa.Integer(), nullable=False),
        sa.Column("catalog", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("schema_", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column(
            "submitted_query",
            sqlmodel.sql.sqltypes.AutoString(),
            nullable=False,
        ),
        sa.Column("executed_query", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("scheduled", sa.DateTime(), nullable=True),
        sa.Column("started", sa.DateTime(), nullable=True),
        sa.Column("finished", sa.DateTime(), nullable=True),
        sa.Column("state", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("progress", sa.Float(), nullable=True),
        sa.ForeignKeyConstraint(
            ["database_id"],
            ["database.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_index(op.f("ix_query_catalog"), "query", ["catalog"], unique=False)
    op.create_index(
        op.f("ix_query_database_id"),
        "query",
        ["database_id"],
        unique=False,
    )
    op.create_index(
        op.f("ix_query_executed_query"),
        "query",
        ["executed_query"],
        unique=False,
    )
    op.create_index(op.f("ix_query_finished"), "query", ["finished"], unique=False)
    op.create_index(op.f("ix_query_progress"), "query", ["progress"], unique=False)
    op.create_index(op.f("ix_query_scheduled"), "query", ["scheduled"], unique=False)
    op.create_index(op.f("ix_query_schema_"), "query", ["schema_"], unique=False)
    op.create_index(op.f("ix_query_started"), "query", ["started"], unique=False)
    op.create_index(op.f("ix_query_state"), "query", ["state"], unique=False)
    op.create_index(
        op.f("ix_query_submitted_query"),
        "query",
        ["submitted_query"],
        unique=False,
    )
    op.create_table(
        "table",
        sa.Column("id", sa.Integer(), nullable=True),
        sa.Column("node_id", sa.Integer(), nullable=False),
        sa.Column("database_id", sa.Integer(), nullable=False),
        sa.Column("catalog", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("schema_", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
        sa.Column("table", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
        sa.Column("cost", sa.Float(), nullable=True),
        sa.ForeignKeyConstraint(
            ["database_id"],
            ["database.id"],
        ),
        sa.ForeignKeyConstraint(
            ["node_id"],
            ["node.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_index(op.f("ix_table_catalog"), "table", ["catalog"], unique=False)
    op.create_index(op.f("ix_table_cost"), "table", ["cost"], unique=False)
    op.create_index(
        op.f("ix_table_database_id"),
        "table",
        ["database_id"],
        unique=False,
    )
    op.create_index(op.f("ix_table_id"), "table", ["id"], unique=False)
    op.create_index(op.f("ix_table_node_id"), "table", ["node_id"], unique=False)
    op.create_index(op.f("ix_table_schema_"), "table", ["schema_"], unique=False)
    op.create_index(op.f("ix_table_table"), "table", ["table"], unique=False)
    op.create_table(
        "nodecolumns",
        sa.Column("node_id", sa.Integer(), nullable=True),
        sa.Column("column_id", sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ["column_id"],
            ["column.id"],
        ),
        sa.ForeignKeyConstraint(
            ["node_id"],
            ["node.id"],
        ),
        sa.PrimaryKeyConstraint("node_id", "column_id"),
    )
    op.create_index(
        op.f("ix_nodecolumns_column_id"),
        "nodecolumns",
        ["column_id"],
        unique=False,
    )
    op.create_index(
        op.f("ix_nodecolumns_node_id"),
        "nodecolumns",
        ["node_id"],
        unique=False,
    )
    op.create_table(
        "tablecolumns",
        sa.Column("table_id", sa.Integer(), nullable=True),
        sa.Column("column_id", sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ["column_id"],
            ["column.id"],
        ),
        sa.ForeignKeyConstraint(
            ["table_id"],
            ["table.id"],
        ),
        sa.PrimaryKeyConstraint("table_id", "column_id"),
    )
    op.create_index(
        op.f("ix_tablecolumns_column_id"),
        "tablecolumns",
        ["column_id"],
        unique=False,
    )
    op.create_index(
        op.f("ix_tablecolumns_table_id"),
        "tablecolumns",
        ["table_id"],
        unique=False,
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_tablecolumns_table_id"), table_name="tablecolumns")
    op.drop_index(op.f("ix_tablecolumns_column_id"), table_name="tablecolumns")
    op.drop_table("tablecolumns")
    op.drop_index(op.f("ix_nodecolumns_node_id"), table_name="nodecolumns")
    op.drop_index(op.f("ix_nodecolumns_column_id"), table_name="nodecolumns")
    op.drop_table("nodecolumns")
    op.drop_index(op.f("ix_table_table"), table_name="table")
    op.drop_index(op.f("ix_table_schema_"), table_name="table")
    op.drop_index(op.f("ix_table_node_id"), table_name="table")
    op.drop_index(op.f("ix_table_id"), table_name="table")
    op.drop_index(op.f("ix_table_database_id"), table_name="table")
    op.drop_index(op.f("ix_table_cost"), table_name="table")
    op.drop_index(op.f("ix_table_catalog"), table_name="table")
    op.drop_table("table")
    op.drop_index(op.f("ix_query_submitted_query"), table_name="query")
    op.drop_index(op.f("ix_query_state"), table_name="query")
    op.drop_index(op.f("ix_query_started"), table_name="query")
    op.drop_index(op.f("ix_query_schema_"), table_name="query")
    op.drop_index(op.f("ix_query_scheduled"), table_name="query")
    op.drop_index(op.f("ix_query_progress"), table_name="query")
    op.drop_index(op.f("ix_query_finished"), table_name="query")
    op.drop_index(op.f("ix_query_executed_query"), table_name="query")
    op.drop_index(op.f("ix_query_database_id"), table_name="query")
    op.drop_index(op.f("ix_query_catalog"), table_name="query")
    op.drop_table("query")
    op.drop_index(op.f("ix_noderelationship_parent_id"), table_name="noderelationship")
    op.drop_index(op.f("ix_noderelationship_child_id"), table_name="noderelationship")
    op.drop_table("noderelationship")
    op.drop_index(op.f("ix_column_name"), table_name="column")
    op.drop_index(op.f("ix_column_id"), table_name="column")
    op.drop_index(op.f("ix_column_dimension_id"), table_name="column")
    op.drop_index(op.f("ix_column_dimension_column"), table_name="column")
    op.drop_table("column")
    op.drop_index(op.f("ix_node_id"), table_name="node")
    op.drop_index(op.f("ix_node_expression"), table_name="node")
    op.drop_index(op.f("ix_node_description"), table_name="node")
    op.drop_table("node")
    op.drop_index(op.f("ix_database_read_only"), table_name="database")
    op.drop_index(op.f("ix_database_id"), table_name="database")
    op.drop_index(op.f("ix_database_description"), table_name="database")
    op.drop_index(op.f("ix_database_cost"), table_name="database")
    op.drop_index(op.f("ix_database_async"), table_name="database")
    op.drop_index(op.f("ix_database_URI"), table_name="database")
    op.drop_table("database")
    # ### end Alembic commands ###

sqlalchemy_utils.types.uuid.UUIDType sqlmodel.sql.sqltypes.AutoString sqlalchemy.Integer alembic.op.drop_table sqlalchemy.Float sqlalchemy.UniqueConstraint sqlalchemy.PrimaryKeyConstraint sqlalchemy.DateTime alembic.op.f sqlalchemy.String sqlalchemy.Boolean sqlalchemy.Enum sqlalchemy.ForeignKeyConstraint
[((9906, 9935), 'alembic.op.drop_table', 'op.drop_table', (['"""tablecolumns"""'], {}), "('tablecolumns')\n", (9919, 9935), False, 'from alembic import op\n'), ((10094, 10122), 'alembic.op.drop_table', 'op.drop_table', (['"""nodecolumns"""'], {}), "('nodecolumns')\n", (10107, 10122), False, 'from alembic import op\n'), ((10569, 10591), 'alembic.op.drop_table', 'op.drop_table', (['"""table"""'], {}), "('table')\n", (10582, 10591), False, 'from alembic import op\n'), ((11257, 11279), 'alembic.op.drop_table', 'op.drop_table', (['"""query"""'], {}), "('query')\n", (11270, 11279), False, 'from alembic import op\n'), ((11459, 11492), 'alembic.op.drop_table', 'op.drop_table', (['"""noderelationship"""'], {}), "('noderelationship')\n", (11472, 11492), False, 'from alembic import op\n'), ((11767, 11790), 'alembic.op.drop_table', 'op.drop_table', (['"""column"""'], {}), "('column')\n", (11780, 11790), False, 'from alembic import op\n'), ((11983, 12004), 'alembic.op.drop_table', 'op.drop_table', (['"""node"""'], {}), "('node')\n", (11996, 12004), False, 'from alembic import op\n'), ((12421, 12446), 'alembic.op.drop_table', 'op.drop_table', (['"""database"""'], {}), "('database')\n", (12434, 12446), False, 'from alembic import op\n'), ((1138, 1167), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (1161, 1167), True, 'import sqlalchemy as sa\n'), ((1177, 1204), 'sqlalchemy.UniqueConstraint', 'sa.UniqueConstraint', (['"""name"""'], {}), "('name')\n", (1196, 1204), True, 'import sqlalchemy as sa\n'), ((1232, 1255), 'alembic.op.f', 'op.f', (['"""ix_database_URI"""'], {}), "('ix_database_URI')\n", (1236, 1255), False, 'from alembic import op\n'), ((1312, 1337), 'alembic.op.f', 'op.f', (['"""ix_database_async"""'], {}), "('ix_database_async')\n", (1316, 1337), False, 'from alembic import op\n'), ((1396, 1420), 'alembic.op.f', 'op.f', (['"""ix_database_cost"""'], {}), "('ix_database_cost')\n", (1400, 1420), False, 'from alembic import op\n'), ((1487, 1518), 'alembic.op.f', 'op.f', (['"""ix_database_description"""'], {}), "('ix_database_description')\n", (1491, 1518), False, 'from alembic import op\n'), ((1613, 1635), 'alembic.op.f', 'op.f', (['"""ix_database_id"""'], {}), "('ix_database_id')\n", (1617, 1635), False, 'from alembic import op\n'), ((1700, 1729), 'alembic.op.f', 'op.f', (['"""ix_database_read_only"""'], {}), "('ix_database_read_only')\n", (1704, 1729), False, 'from alembic import op\n'), ((2438, 2467), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (2461, 2467), True, 'import sqlalchemy as sa\n'), ((2477, 2504), 'sqlalchemy.UniqueConstraint', 'sa.UniqueConstraint', (['"""name"""'], {}), "('name')\n", (2496, 2504), True, 'import sqlalchemy as sa\n'), ((2532, 2559), 'alembic.op.f', 'op.f', (['"""ix_node_description"""'], {}), "('ix_node_description')\n", (2536, 2559), False, 'from alembic import op\n'), ((2620, 2646), 'alembic.op.f', 'op.f', (['"""ix_node_expression"""'], {}), "('ix_node_expression')\n", (2624, 2646), False, 'from alembic import op\n'), ((2706, 2724), 'alembic.op.f', 'op.f', (['"""ix_node_id"""'], {}), "('ix_node_id')\n", (2710, 2724), False, 'from alembic import op\n'), ((3585, 3639), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['dimension_id']", "['node.id']"], {}), "(['dimension_id'], ['node.id'])\n", (3608, 3639), True, 'import sqlalchemy as sa\n'), ((3684, 3713), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (3707, 3713), True, 'import sqlalchemy as sa\n'), ((3750, 3784), 'alembic.op.f', 'op.f', (['"""ix_column_dimension_column"""'], {}), "('ix_column_dimension_column')\n", (3754, 3784), False, 'from alembic import op\n'), ((3891, 3921), 'alembic.op.f', 'op.f', (['"""ix_column_dimension_id"""'], {}), "('ix_column_dimension_id')\n", (3895, 3921), False, 'from alembic import op\n'), ((4015, 4035), 'alembic.op.f', 'op.f', (['"""ix_column_id"""'], {}), "('ix_column_id')\n", (4019, 4035), False, 'from alembic import op\n'), ((4089, 4111), 'alembic.op.f', 'op.f', (['"""ix_column_name"""'], {}), "('ix_column_name')\n", (4093, 4111), False, 'from alembic import op\n'), ((4325, 4375), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['child_id']", "['node.id']"], {}), "(['child_id'], ['node.id'])\n", (4348, 4375), True, 'import sqlalchemy as sa\n'), ((4420, 4471), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['parent_id']", "['node.id']"], {}), "(['parent_id'], ['node.id'])\n", (4443, 4471), True, 'import sqlalchemy as sa\n'), ((4516, 4564), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""parent_id"""', '"""child_id"""'], {}), "('parent_id', 'child_id')\n", (4539, 4564), True, 'import sqlalchemy as sa\n'), ((4601, 4637), 'alembic.op.f', 'op.f', (['"""ix_noderelationship_child_id"""'], {}), "('ix_noderelationship_child_id')\n", (4605, 4637), False, 'from alembic import op\n'), ((4746, 4783), 'alembic.op.f', 'op.f', (['"""ix_noderelationship_parent_id"""'], {}), "('ix_noderelationship_parent_id')\n", (4750, 4783), False, 'from alembic import op\n'), ((5762, 5819), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['database_id']", "['database.id']"], {}), "(['database_id'], ['database.id'])\n", (5785, 5819), True, 'import sqlalchemy as sa\n'), ((5864, 5893), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (5887, 5893), True, 'import sqlalchemy as sa\n'), ((5921, 5945), 'alembic.op.f', 'op.f', (['"""ix_query_catalog"""'], {}), "('ix_query_catalog')\n", (5925, 5945), False, 'from alembic import op\n'), ((6012, 6040), 'alembic.op.f', 'op.f', (['"""ix_query_database_id"""'], {}), "('ix_query_database_id')\n", (6016, 6040), False, 'from alembic import op\n'), ((6141, 6172), 'alembic.op.f', 'op.f', (['"""ix_query_executed_query"""'], {}), "('ix_query_executed_query')\n", (6145, 6172), False, 'from alembic import op\n'), ((6267, 6292), 'alembic.op.f', 'op.f', (['"""ix_query_finished"""'], {}), "('ix_query_finished')\n", (6271, 6292), False, 'from alembic import op\n'), ((6351, 6376), 'alembic.op.f', 'op.f', (['"""ix_query_progress"""'], {}), "('ix_query_progress')\n", (6355, 6376), False, 'from alembic import op\n'), ((6435, 6461), 'alembic.op.f', 'op.f', (['"""ix_query_scheduled"""'], {}), "('ix_query_scheduled')\n", (6439, 6461), False, 'from alembic import op\n'), ((6521, 6545), 'alembic.op.f', 'op.f', (['"""ix_query_schema_"""'], {}), "('ix_query_schema_')\n", (6525, 6545), False, 'from alembic import op\n'), ((6603, 6627), 'alembic.op.f', 'op.f', (['"""ix_query_started"""'], {}), "('ix_query_started')\n", (6607, 6627), False, 'from alembic import op\n'), ((6685, 6707), 'alembic.op.f', 'op.f', (['"""ix_query_state"""'], {}), "('ix_query_state')\n", (6689, 6707), False, 'from alembic import op\n'), ((6772, 6804), 'alembic.op.f', 'op.f', (['"""ix_query_submitted_query"""'], {}), "('ix_query_submitted_query')\n", (6776, 6804), False, 'from alembic import op\n'), ((7400, 7457), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['database_id']", "['database.id']"], {}), "(['database_id'], ['database.id'])\n", (7423, 7457), True, 'import sqlalchemy as sa\n'), ((7502, 7551), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['node_id']", "['node.id']"], {}), "(['node_id'], ['node.id'])\n", (7525, 7551), True, 'import sqlalchemy as sa\n'), ((7596, 7625), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (7619, 7625), True, 'import sqlalchemy as sa\n'), ((7653, 7677), 'alembic.op.f', 'op.f', (['"""ix_table_catalog"""'], {}), "('ix_table_catalog')\n", (7657, 7677), False, 'from alembic import op\n'), ((7735, 7756), 'alembic.op.f', 'op.f', (['"""ix_table_cost"""'], {}), "('ix_table_cost')\n", (7739, 7756), False, 'from alembic import op\n'), ((7820, 7848), 'alembic.op.f', 'op.f', (['"""ix_table_database_id"""'], {}), "('ix_table_database_id')\n", (7824, 7848), False, 'from alembic import op\n'), ((7940, 7959), 'alembic.op.f', 'op.f', (['"""ix_table_id"""'], {}), "('ix_table_id')\n", (7944, 7959), False, 'from alembic import op\n'), ((8012, 8036), 'alembic.op.f', 'op.f', (['"""ix_table_node_id"""'], {}), "('ix_table_node_id')\n", (8016, 8036), False, 'from alembic import op\n'), ((8094, 8118), 'alembic.op.f', 'op.f', (['"""ix_table_schema_"""'], {}), "('ix_table_schema_')\n", (8098, 8118), False, 'from alembic import op\n'), ((8176, 8198), 'alembic.op.f', 'op.f', (['"""ix_table_table"""'], {}), "('ix_table_table')\n", (8180, 8198), False, 'from alembic import op\n'), ((8406, 8459), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['column_id']", "['column.id']"], {}), "(['column_id'], ['column.id'])\n", (8429, 8459), True, 'import sqlalchemy as sa\n'), ((8504, 8553), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['node_id']", "['node.id']"], {}), "(['node_id'], ['node.id'])\n", (8527, 8553), True, 'import sqlalchemy as sa\n'), ((8598, 8645), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""node_id"""', '"""column_id"""'], {}), "('node_id', 'column_id')\n", (8621, 8645), True, 'import sqlalchemy as sa\n'), ((8682, 8714), 'alembic.op.f', 'op.f', (['"""ix_nodecolumns_column_id"""'], {}), "('ix_nodecolumns_column_id')\n", (8686, 8714), False, 'from alembic import op\n'), ((8819, 8849), 'alembic.op.f', 'op.f', (['"""ix_nodecolumns_node_id"""'], {}), "('ix_nodecolumns_node_id')\n", (8823, 8849), False, 'from alembic import op\n'), ((9097, 9150), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['column_id']", "['column.id']"], {}), "(['column_id'], ['column.id'])\n", (9120, 9150), True, 'import sqlalchemy as sa\n'), ((9195, 9246), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['table_id']", "['table.id']"], {}), "(['table_id'], ['table.id'])\n", (9218, 9246), True, 'import sqlalchemy as sa\n'), ((9291, 9339), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""table_id"""', '"""column_id"""'], {}), "('table_id', 'column_id')\n", (9314, 9339), True, 'import sqlalchemy as sa\n'), ((9376, 9409), 'alembic.op.f', 'op.f', (['"""ix_tablecolumns_column_id"""'], {}), "('ix_tablecolumns_column_id')\n", (9380, 9409), False, 'from alembic import op\n'), ((9515, 9547), 'alembic.op.f', 'op.f', (['"""ix_tablecolumns_table_id"""'], {}), "('ix_tablecolumns_table_id')\n", (9519, 9547), False, 'from alembic import op\n'), ((9761, 9793), 'alembic.op.f', 'op.f', (['"""ix_tablecolumns_table_id"""'], {}), "('ix_tablecolumns_table_id')\n", (9765, 9793), False, 'from alembic import op\n'), ((9840, 9873), 'alembic.op.f', 'op.f', (['"""ix_tablecolumns_column_id"""'], {}), "('ix_tablecolumns_column_id')\n", (9844, 9873), False, 'from alembic import op\n'), ((9954, 9984), 'alembic.op.f', 'op.f', (['"""ix_nodecolumns_node_id"""'], {}), "('ix_nodecolumns_node_id')\n", (9958, 9984), False, 'from alembic import op\n'), ((10030, 10062), 'alembic.op.f', 'op.f', (['"""ix_nodecolumns_column_id"""'], {}), "('ix_nodecolumns_column_id')\n", (10034, 10062), False, 'from alembic import op\n'), ((10141, 10163), 'alembic.op.f', 'op.f', (['"""ix_table_table"""'], {}), "('ix_table_table')\n", (10145, 10163), False, 'from alembic import op\n'), ((10203, 10227), 'alembic.op.f', 'op.f', (['"""ix_table_schema_"""'], {}), "('ix_table_schema_')\n", (10207, 10227), False, 'from alembic import op\n'), ((10267, 10291), 'alembic.op.f', 'op.f', (['"""ix_table_node_id"""'], {}), "('ix_table_node_id')\n", (10271, 10291), False, 'from alembic import op\n'), ((10331, 10350), 'alembic.op.f', 'op.f', (['"""ix_table_id"""'], {}), "('ix_table_id')\n", (10335, 10350), False, 'from alembic import op\n'), ((10390, 10418), 'alembic.op.f', 'op.f', (['"""ix_table_database_id"""'], {}), "('ix_table_database_id')\n", (10394, 10418), False, 'from alembic import op\n'), ((10458, 10479), 'alembic.op.f', 'op.f', (['"""ix_table_cost"""'], {}), "('ix_table_cost')\n", (10462, 10479), False, 'from alembic import op\n'), ((10519, 10543), 'alembic.op.f', 'op.f', (['"""ix_table_catalog"""'], {}), "('ix_table_catalog')\n", (10523, 10543), False, 'from alembic import op\n'), ((10610, 10642), 'alembic.op.f', 'op.f', (['"""ix_query_submitted_query"""'], {}), "('ix_query_submitted_query')\n", (10614, 10642), False, 'from alembic import op\n'), ((10682, 10704), 'alembic.op.f', 'op.f', (['"""ix_query_state"""'], {}), "('ix_query_state')\n", (10686, 10704), False, 'from alembic import op\n'), ((10744, 10768), 'alembic.op.f', 'op.f', (['"""ix_query_started"""'], {}), "('ix_query_started')\n", (10748, 10768), False, 'from alembic import op\n'), ((10808, 10832), 'alembic.op.f', 'op.f', (['"""ix_query_schema_"""'], {}), "('ix_query_schema_')\n", (10812, 10832), False, 'from alembic import op\n'), ((10872, 10898), 'alembic.op.f', 'op.f', (['"""ix_query_scheduled"""'], {}), "('ix_query_scheduled')\n", (10876, 10898), False, 'from alembic import op\n'), ((10938, 10963), 'alembic.op.f', 'op.f', (['"""ix_query_progress"""'], {}), "('ix_query_progress')\n", (10942, 10963), False, 'from alembic import op\n'), ((11003, 11028), 'alembic.op.f', 'op.f', (['"""ix_query_finished"""'], {}), "('ix_query_finished')\n", (11007, 11028), False, 'from alembic import op\n'), ((11068, 11099), 'alembic.op.f', 'op.f', (['"""ix_query_executed_query"""'], {}), "('ix_query_executed_query')\n", (11072, 11099), False, 'from alembic import op\n'), ((11139, 11167), 'alembic.op.f', 'op.f', (['"""ix_query_database_id"""'], {}), "('ix_query_database_id')\n", (11143, 11167), False, 'from alembic import op\n'), ((11207, 11231), 'alembic.op.f', 'op.f', (['"""ix_query_catalog"""'], {}), "('ix_query_catalog')\n", (11211, 11231), False, 'from alembic import op\n'), ((11298, 11335), 'alembic.op.f', 'op.f', (['"""ix_noderelationship_parent_id"""'], {}), "('ix_noderelationship_parent_id')\n", (11302, 11335), False, 'from alembic import op\n'), ((11386, 11422), 'alembic.op.f', 'op.f', (['"""ix_noderelationship_child_id"""'], {}), "('ix_noderelationship_child_id')\n", (11390, 11422), False, 'from alembic import op\n'), ((11511, 11533), 'alembic.op.f', 'op.f', (['"""ix_column_name"""'], {}), "('ix_column_name')\n", (11515, 11533), False, 'from alembic import op\n'), ((11574, 11594), 'alembic.op.f', 'op.f', (['"""ix_column_id"""'], {}), "('ix_column_id')\n", (11578, 11594), False, 'from alembic import op\n'), ((11635, 11665), 'alembic.op.f', 'op.f', (['"""ix_column_dimension_id"""'], {}), "('ix_column_dimension_id')\n", (11639, 11665), False, 'from alembic import op\n'), ((11706, 11740), 'alembic.op.f', 'op.f', (['"""ix_column_dimension_column"""'], {}), "('ix_column_dimension_column')\n", (11710, 11740), False, 'from alembic import op\n'), ((11809, 11827), 'alembic.op.f', 'op.f', (['"""ix_node_id"""'], {}), "('ix_node_id')\n", (11813, 11827), False, 'from alembic import op\n'), ((11866, 11892), 'alembic.op.f', 'op.f', (['"""ix_node_expression"""'], {}), "('ix_node_expression')\n", (11870, 11892), False, 'from alembic import op\n'), ((11931, 11958), 'alembic.op.f', 'op.f', (['"""ix_node_description"""'], {}), "('ix_node_description')\n", (11935, 11958), False, 'from alembic import op\n'), ((12023, 12052), 'alembic.op.f', 'op.f', (['"""ix_database_read_only"""'], {}), "('ix_database_read_only')\n", (12027, 12052), False, 'from alembic import op\n'), ((12095, 12117), 'alembic.op.f', 'op.f', (['"""ix_database_id"""'], {}), "('ix_database_id')\n", (12099, 12117), False, 'from alembic import op\n'), ((12160, 12191), 'alembic.op.f', 'op.f', (['"""ix_database_description"""'], {}), "('ix_database_description')\n", (12164, 12191), False, 'from alembic import op\n'), ((12234, 12258), 'alembic.op.f', 'op.f', (['"""ix_database_cost"""'], {}), "('ix_database_cost')\n", (12238, 12258), False, 'from alembic import op\n'), ((12301, 12326), 'alembic.op.f', 'op.f', (['"""ix_database_async"""'], {}), "('ix_database_async')\n", (12305, 12326), False, 'from alembic import op\n'), ((12369, 12392), 'alembic.op.f', 'op.f', (['"""ix_database_URI"""'], {}), "('ix_database_URI')\n", (12373, 12392), False, 'from alembic import op\n'), ((560, 571), 'sqlalchemy.String', 'sa.String', ([], {}), '()\n', (569, 571), True, 'import sqlalchemy as sa\n'), ((621, 647), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {'timezone': '(True)'}), '(timezone=True)\n', (632, 647), True, 'import sqlalchemy as sa\n'), ((697, 723), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {'timezone': '(True)'}), '(timezone=True)\n', (708, 723), True, 'import sqlalchemy as sa\n'), ((765, 777), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (775, 777), True, 'import sqlalchemy as sa\n'), ((828, 862), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (860, 862), False, 'import sqlmodel\n'), ((905, 939), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (937, 939), False, 'import sqlmodel\n'), ((989, 1001), 'sqlalchemy.Boolean', 'sa.Boolean', ([], {}), '()\n', (999, 1001), True, 'import sqlalchemy as sa\n'), ((1046, 1058), 'sqlalchemy.Boolean', 'sa.Boolean', ([], {}), '()\n', (1056, 1058), True, 'import sqlalchemy as sa\n'), ((1102, 1112), 'sqlalchemy.Float', 'sa.Float', ([], {}), '()\n', (1110, 1112), True, 'import sqlalchemy as sa\n'), ((1865, 1876), 'sqlalchemy.String', 'sa.String', ([], {}), '()\n', (1874, 1876), True, 'import sqlalchemy as sa\n'), ((1926, 1952), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {'timezone': '(True)'}), '(timezone=True)\n', (1937, 1952), True, 'import sqlalchemy as sa\n'), ((2002, 2028), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {'timezone': '(True)'}), '(timezone=True)\n', (2013, 2028), True, 'import sqlalchemy as sa\n'), ((2097, 2167), 'sqlalchemy.Enum', 'sa.Enum', (['"""SOURCE"""', '"""TRANSFORM"""', '"""METRIC"""', '"""DIMENSION"""'], {'name': '"""nodetype"""'}), "('SOURCE', 'TRANSFORM', 'METRIC', 'DIMENSION', name='nodetype')\n", (2104, 2167), True, 'import sqlalchemy as sa\n'), ((2231, 2243), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (2241, 2243), True, 'import sqlalchemy as sa\n'), ((2294, 2328), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (2326, 2328), False, 'import sqlmodel\n'), ((2378, 2412), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (2410, 2412), False, 'import sqlmodel\n'), ((2846, 2984), 'sqlalchemy.Enum', 'sa.Enum', (['"""BYTES"""', '"""STR"""', '"""FLOAT"""', '"""INT"""', '"""DECIMAL"""', '"""BOOL"""', '"""DATETIME"""', '"""DATE"""', '"""TIME"""', '"""TIMEDELTA"""', '"""LIST"""', '"""DICT"""'], {'name': '"""columntype"""'}), "('BYTES', 'STR', 'FLOAT', 'INT', 'DECIMAL', 'BOOL', 'DATETIME',\n    'DATE', 'TIME', 'TIMEDELTA', 'LIST', 'DICT', name='columntype')\n", (2853, 2984), True, 'import sqlalchemy as sa\n'), ((3267, 3279), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (3277, 3279), True, 'import sqlalchemy as sa\n'), ((3323, 3357), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (3355, 3357), False, 'import sqlmodel\n'), ((3410, 3422), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (3420, 3422), True, 'import sqlalchemy as sa\n'), ((3503, 3537), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (3535, 3537), False, 'import sqlmodel\n'), ((4227, 4239), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (4237, 4239), True, 'import sqlalchemy as sa\n'), ((4287, 4299), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (4297, 4299), True, 'import sqlalchemy as sa\n'), ((4926, 4964), 'sqlalchemy_utils.types.uuid.UUIDType', 'sqlalchemy_utils.types.uuid.UUIDType', ([], {}), '()\n', (4962, 4964), False, 'import sqlalchemy_utils\n'), ((5016, 5028), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (5026, 5028), True, 'import sqlalchemy as sa\n'), ((5076, 5110), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (5108, 5110), False, 'import sqlmodel\n'), ((5157, 5191), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (5189, 5191), False, 'import sqlmodel\n'), ((5271, 5305), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (5303, 5305), False, 'import sqlmodel\n'), ((5382, 5416), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (5414, 5416), False, 'import sqlmodel\n'), ((5465, 5478), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (5476, 5478), True, 'import sqlalchemy as sa\n'), ((5525, 5538), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (5536, 5538), True, 'import sqlalchemy as sa\n'), ((5586, 5599), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (5597, 5599), True, 'import sqlalchemy as sa\n'), ((5644, 5678), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (5676, 5678), False, 'import sqlmodel\n'), ((5726, 5736), 'sqlalchemy.Float', 'sa.Float', ([], {}), '()\n', (5734, 5736), True, 'import sqlalchemy as sa\n'), ((6942, 6954), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (6952, 6954), True, 'import sqlalchemy as sa\n'), ((7001, 7013), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (7011, 7013), True, 'import sqlalchemy as sa\n'), ((7065, 7077), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (7075, 7077), True, 'import sqlalchemy as sa\n'), ((7125, 7159), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (7157, 7159), False, 'import sqlmodel\n'), ((7206, 7240), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (7238, 7240), False, 'import sqlmodel\n'), ((7285, 7319), 'sqlmodel.sql.sqltypes.AutoString', 'sqlmodel.sql.sqltypes.AutoString', ([], {}), '()\n', (7317, 7319), False, 'import sqlmodel\n'), ((7364, 7374), 'sqlalchemy.Float', 'sa.Float', ([], {}), '()\n', (7372, 7374), True, 'import sqlalchemy as sa\n'), ((8307, 8319), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (8317, 8319), True, 'import sqlalchemy as sa\n'), ((8368, 8380), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (8378, 8380), True, 'import sqlalchemy as sa\n'), ((8998, 9010), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (9008, 9010), True, 'import sqlalchemy as sa\n'), ((9059, 9071), 'sqlalchemy.Integer', 'sa.Integer', ([], {}), '()\n', (9069, 9071), True, 'import sqlalchemy as sa\n')]