Example #1
0
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    op.drop_column(u"repository", "state")

    op.drop_table("repomirrorconfig")

    op.drop_table("repomirrorrule")

    for logentrykind in [
            "repo_mirror_enabled",
            "repo_mirror_disabled",
            "repo_mirror_config_changed",
            "repo_mirror_sync_started",
            "repo_mirror_sync_failed",
            "repo_mirror_sync_success",
            "repo_mirror_sync_now_requested",
            "repo_mirror_sync_tag_success",
            "repo_mirror_sync_tag_failed",
            "repo_mirror_sync_test_success",
            "repo_mirror_sync_test_failed",
            "repo_mirror_sync_test_started",
            "change_repo_state",
    ]:
        op.execute(tables.logentrykind.delete().where(
            tables.logentrykind.c.name == op.inline_literal(logentrykind)))
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column(u'repositorybuildtrigger', 'secure_private_key')
    op.drop_column(u'repositorybuildtrigger', 'secure_auth_token')

    op.drop_index('oauthauthorizationcode_code',
                  table_name='oauthauthorizationcode')
    op.create_index('oauthauthorizationcode_code',
                    'oauthauthorizationcode', ['code'],
                    unique=False)
    op.drop_index('oauthauthorizationcode_code_name',
                  table_name='oauthauthorizationcode')
    op.drop_column(u'oauthauthorizationcode', 'code_name')
    op.drop_column(u'oauthauthorizationcode', 'code_credential')

    op.drop_column(u'oauthapplication', 'secure_client_secret')

    op.drop_index('oauthaccesstoken_token_name', table_name='oauthaccesstoken')
    op.drop_column(u'oauthaccesstoken', 'token_name')
    op.drop_column(u'oauthaccesstoken', 'token_code')

    op.drop_column(u'emailconfirmation', 'verification_code')

    op.drop_index('appspecificauthtoken_token_name',
                  table_name='appspecificauthtoken')
    op.drop_column(u'appspecificauthtoken', 'token_secret')
    op.drop_column(u'appspecificauthtoken', 'token_name')

    op.drop_index('accesstoken_token_name', table_name='accesstoken')
    op.drop_column(u'accesstoken', 'token_name')
    op.drop_column(u'accesstoken', 'token_code')

    op.drop_table('robotaccounttoken')
Example #3
0
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column(u"repositorybuildtrigger", "secure_private_key")
    op.drop_column(u"repositorybuildtrigger", "secure_auth_token")

    op.drop_index("oauthauthorizationcode_code",
                  table_name="oauthauthorizationcode")
    op.create_index("oauthauthorizationcode_code",
                    "oauthauthorizationcode", ["code"],
                    unique=False)
    op.drop_index("oauthauthorizationcode_code_name",
                  table_name="oauthauthorizationcode")
    op.drop_column(u"oauthauthorizationcode", "code_name")
    op.drop_column(u"oauthauthorizationcode", "code_credential")

    op.drop_column(u"oauthapplication", "secure_client_secret")

    op.drop_index("oauthaccesstoken_token_name", table_name="oauthaccesstoken")
    op.drop_column(u"oauthaccesstoken", "token_name")
    op.drop_column(u"oauthaccesstoken", "token_code")

    op.drop_column(u"emailconfirmation", "verification_code")

    op.drop_index("appspecificauthtoken_token_name",
                  table_name="appspecificauthtoken")
    op.drop_column(u"appspecificauthtoken", "token_secret")
    op.drop_column(u"appspecificauthtoken", "token_name")

    op.drop_index("accesstoken_token_name", table_name="accesstoken")
    op.drop_column(u"accesstoken", "token_name")
    op.drop_column(u"accesstoken", "token_code")

    op.drop_table("robotaccounttoken")
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    op.drop_constraint(op.f('fk_repository_kind_id_repositorykind'),
                       'repository',
                       type_='foreignkey')
    op.drop_index('repository_kind_id', table_name='repository')
    op.drop_column(u'repository', 'kind_id')
    op.drop_table('repositorykind')
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    op.drop_constraint(op.f("fk_repository_kind_id_repositorykind"),
                       "repository",
                       type_="foreignkey")
    op.drop_index("repository_kind_id", table_name="repository")
    op.drop_column(u"repository", "kind_id")
    op.drop_table("repositorykind")
Example #6
0
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("appspecificauthtoken")
    # ### end Alembic commands ###

    op.execute(tables.logentrykind.delete().where(
        tables.logentrykind.name == op.inline_literal(
            "create_app_specific_token")))

    op.execute(tables.logentrykind.delete().where(
        tables.logentrykind.name == op.inline_literal(
            "revoke_app_specific_token")))
Example #7
0
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(
        op.f('fk_repositorybuildtrigger_disabled_reason_id_disablereason'),
        'repositorybuildtrigger',
        type_='foreignkey')
    op.drop_index('repositorybuildtrigger_disabled_reason_id',
                  table_name='repositorybuildtrigger')
    op.drop_column(u'repositorybuildtrigger', 'enabled')
    op.drop_column(u'repositorybuildtrigger', 'disabled_reason_id')
    op.drop_table('disablereason')
    # ### end Alembic commands ###

    op.execute(tables.logentrykind.delete().where(
        tables.logentrykind.c.name == op.inline_literal(
            'toggle_repo_trigger')))
def upgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    # Note: Because of a restriction in MySQL, we cannot simply remove the index and re-add
    # it without the unique=False, nor can we simply alter the index. To make it work, we'd have to
    # remove the primary key on the field, so instead we simply drop the table entirely and
    # recreate it with the modified index. The backfill will re-fill this in.
    op.drop_table("tagmanifesttomanifest")

    op.create_table(
        "tagmanifesttomanifest",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("tag_manifest_id", sa.Integer(), nullable=False),
        sa.Column("manifest_id", sa.Integer(), nullable=False),
        sa.Column("broken", sa.Boolean(), nullable=False, server_default=sa.sql.expression.false()),
        sa.ForeignKeyConstraint(
            ["manifest_id"],
            ["manifest.id"],
            name=op.f("fk_tagmanifesttomanifest_manifest_id_manifest"),
        ),
        sa.ForeignKeyConstraint(
            ["tag_manifest_id"],
            ["tagmanifest.id"],
            name=op.f("fk_tagmanifesttomanifest_tag_manifest_id_tagmanifest"),
        ),
        sa.PrimaryKeyConstraint("id", name=op.f("pk_tagmanifesttomanifest")),
    )
    op.create_index(
        "tagmanifesttomanifest_broken", "tagmanifesttomanifest", ["broken"], unique=False
    )
    op.create_index(
        "tagmanifesttomanifest_manifest_id", "tagmanifesttomanifest", ["manifest_id"], unique=False
    )
    op.create_index(
        "tagmanifesttomanifest_tag_manifest_id",
        "tagmanifesttomanifest",
        ["tag_manifest_id"],
        unique=True,
    )

    tester.populate_table(
        "tagmanifesttomanifest",
        [
            ("manifest_id", tester.TestDataType.Foreign("manifest")),
            ("tag_manifest_id", tester.TestDataType.Foreign("tagmanifest")),
        ],
    )
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(
        op.f("fk_repositorybuildtrigger_disabled_reason_id_disablereason"),
        "repositorybuildtrigger",
        type_="foreignkey",
    )
    op.drop_index("repositorybuildtrigger_disabled_reason_id",
                  table_name="repositorybuildtrigger")
    op.drop_column(u"repositorybuildtrigger", "enabled")
    op.drop_column(u"repositorybuildtrigger", "disabled_reason_id")
    op.drop_table("disablereason")
    # ### end Alembic commands ###

    op.execute(tables.logentrykind.delete().where(
        tables.logentrykind.c.name == op.inline_literal(
            "toggle_repo_trigger")))
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('robotaccountmetadata')
def upgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('tag')
    op.drop_table('manifestlistmanifest')
    op.drop_table('manifestlist')
    op.drop_table('manifestblob')
    op.drop_table('manifest')
    op.drop_table('blobplacement')
    op.drop_table('blob')
    op.drop_table('blobplacementlocation')
    op.drop_table('tagkind')
def upgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("derivedimage")
    op.drop_table("manifestlabel")
    op.drop_table("blobplacementlocationpreference")
    op.drop_table("blobuploading")
    op.drop_table("bittorrentpieces")
    op.drop_table("manifestlayerdockerv1")
    op.drop_table("manifestlayerscan")
    op.drop_table("manifestlayer")
Example #13
0
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    for media_type in DOCKER_SCHEMA1_CONTENT_TYPES:
        op.execute(tables.mediatype.delete().where(
            tables.mediatype.c.name == op.inline_literal(media_type)))

    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("tagmanifestlabelmap")
    op.drop_table("tagmanifesttomanifest")
    op.drop_table("manifestlegacyimage")
    op.drop_table("manifestlabel")
    op.drop_table("manifestblob")
    op.drop_table("manifest")
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('tag')
    op.drop_table('manifestchild')
    op.drop_table('tagkind')
Example #15
0
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('namespacegeorestriction')
Example #16
0
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    op.drop_table("manifestlayerscan")
    op.drop_table("manifestlayerdockerv1")
    op.drop_table("tag")
    op.drop_table("manifestlistmanifest")
    op.drop_table("manifestlayer")
    op.drop_table("manifestlabel")
    op.drop_table("manifestblob")
    op.drop_table("derivedimage")
    op.drop_table("blobuploading")
    op.drop_table("blobplacement")
    op.drop_table("bittorrentpieces")
    op.drop_table("manifestlist")
    op.drop_table("manifest")
    op.drop_table("blobplacementlocationpreference")
    op.drop_table("blob")
    op.drop_table("tagkind")
    op.drop_table("blobplacementlocation")
Example #17
0
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("teamsync")
Example #18
0
def downgrade(tables, tester, progress_reporter):
    op = ProgressWrapper(original_op, progress_reporter)
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("apprtag")
    op.drop_table("apprmanifestlistmanifest")
    op.drop_table("apprmanifestblob")
    op.drop_table("apprblobplacement")
    op.drop_table("apprmanifestlist")
    op.drop_table("apprmanifest")
    op.drop_table("apprblob")
    op.drop_table("apprtagkind")
    op.drop_table("apprblobplacementlocation")
Example #19
0
def downgrade(tables, tester, progress_reporter):
  op = ProgressWrapper(original_op, progress_reporter)
  op.drop_table('manifestlayerscan')
  op.drop_table('manifestlayerdockerv1')
  op.drop_table('tag')
  op.drop_table('manifestlistmanifest')
  op.drop_table('manifestlayer')
  op.drop_table('manifestlabel')
  op.drop_table('manifestblob')
  op.drop_table('derivedimage')
  op.drop_table('blobuploading')
  op.drop_table('blobplacement')
  op.drop_table('bittorrentpieces')
  op.drop_table('manifestlist')
  op.drop_table('manifest')
  op.drop_table('blobplacementlocationpreference')
  op.drop_table('blob')
  op.drop_table('tagkind')
  op.drop_table('blobplacementlocation')