Ejemplo n.º 1
0
def upgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "teamsync",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("team_id", sa.Integer(), nullable=False),
        sa.Column("transaction_id", sa.String(length=255), nullable=False),
        sa.Column("last_updated", sa.DateTime(), nullable=True),
        sa.Column("service_id", sa.Integer(), nullable=False),
        sa.Column("config", UTF8LongText(), nullable=False),
        sa.ForeignKeyConstraint(
            ["service_id"], ["loginservice.id"], name=op.f("fk_teamsync_service_id_loginservice")
        ),
        sa.ForeignKeyConstraint(["team_id"], ["team.id"], name=op.f("fk_teamsync_team_id_team")),
        sa.PrimaryKeyConstraint("id", name=op.f("pk_teamsync")),
    )
    op.create_index("teamsync_last_updated", "teamsync", ["last_updated"], unique=False)
    op.create_index("teamsync_service_id", "teamsync", ["service_id"], unique=False)
    op.create_index("teamsync_team_id", "teamsync", ["team_id"], unique=True)
    ### end Alembic commands ###

    # ### population of test data ### #
    tester.populate_table(
        "teamsync",
        [
            ("team_id", tester.TestDataType.Foreign("team")),
            ("transaction_id", tester.TestDataType.String),
            ("last_updated", tester.TestDataType.DateTime),
            ("service_id", tester.TestDataType.Foreign("loginservice")),
            ("config", tester.TestDataType.JSON),
        ],
    )
Ejemplo n.º 2
0
def upgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'teamsync', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('team_id', sa.Integer(), nullable=False),
        sa.Column('transaction_id', sa.String(length=255), nullable=False),
        sa.Column('last_updated', sa.DateTime(), nullable=True),
        sa.Column('service_id', sa.Integer(), nullable=False),
        sa.Column('config', UTF8LongText(), nullable=False),
        sa.ForeignKeyConstraint(
            ['service_id'], ['loginservice.id'],
            name=op.f('fk_teamsync_service_id_loginservice')),
        sa.ForeignKeyConstraint(['team_id'], ['team.id'],
                                name=op.f('fk_teamsync_team_id_team')),
        sa.PrimaryKeyConstraint('id', name=op.f('pk_teamsync')))
    op.create_index('teamsync_last_updated',
                    'teamsync', ['last_updated'],
                    unique=False)
    op.create_index('teamsync_service_id',
                    'teamsync', ['service_id'],
                    unique=False)
    op.create_index('teamsync_team_id', 'teamsync', ['team_id'], unique=True)
    ### end Alembic commands ###

    # ### population of test data ### #
    tester.populate_table('teamsync', [
        ('team_id', tester.TestDataType.Foreign('team')),
        ('transaction_id', tester.TestDataType.String),
        ('last_updated', tester.TestDataType.DateTime),
        ('service_id', tester.TestDataType.Foreign('loginservice')),
        ('config', tester.TestDataType.JSON),
    ])
def downgrade(op, tables, tester):
    op.alter_column("manifest",
                    "manifest_bytes",
                    existing_type=UTF8LongText(),
                    type_=sa.Text())
Ejemplo n.º 4
0
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    op.alter_column("manifest",
                    "manifest_bytes",
                    existing_type=UTF8LongText(),
                    type_=sa.Text())
Ejemplo n.º 5
0
def upgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    op.alter_column('manifest', 'manifest_bytes', existing_type=sa.Text(), type_=UTF8LongText())