def METHOD_NAME():
    op.drop_column('package', 'type')
    op.drop_column('package_revision', 'type')
    op.drop_column('group', 'type')
    op.drop_column('group_revision', 'type')
    op.drop_constraint('member_revision_continuity_id_fkey', 'member_revision')
    op.drop_constraint('member_revision_group_id_fkey', 'member_revision')
    op.drop_constraint('member_revision_revision_id_fkey', 'member_revision')
    op.drop_constraint('member_group_id_fkey', 'member')
    op.drop_constraint('member_revision_id_fkey', 'member')
    op.drop_constraint('member_revision_pkey', 'member_revision')
    op.drop_constraint('member_pkey', 'member')
    op.drop_column('member_revision', 'table_name')
    op.drop_column('member_revision', 'capacity')
    op.drop_column('member', 'table_name')
    op.drop_column('member', 'capacity')
    op.alter_column(
        'member_revision',
        'table_id',
        new_column_name='package_id',
        nullable=True
    )
    op.alter_column(
        'member', 'table_id', new_column_name='package_id', nullable=True
    )
    op.create_primary_key('package_group_pkey', 'member', ['id'])
    op.create_primary_key(
        'package_group_revision_pkey', 'member_revision',
        ['id', 'revision_id']
    )
    op.create_foreign_key(
        'package_group_group_id_fkey', 'member', 'group', ['group_id'], ['id']
    )
    op.create_foreign_key(
        'package_group_package_id_fkey', 'member', 'package', ['package_id'],
        ['id']
    )
    op.create_foreign_key(
        'package_group_revision_id_fkey', 'member', 'revision',
        ['revision_id'], ['id']
    )
    op.create_foreign_key(
        'package_group_revision_continuity_id_fkey', 'member_revision',
        'member', ['continuity_id'], ['id']
    )
    op.create_foreign_key(
        'package_group_revision_group_id_fkey', 'member_revision', 'group',
        ['group_id'], ['id']
    )
    op.create_foreign_key(
        'package_group_revision_package_id_fkey', 'member_revision', 'package',
        ['package_id'], ['id']
    )
    op.create_foreign_key(
        'package_group_revision_revision_id_fkey', 'member_revision',
        'revision', ['revision_id'], ['id']
    )
    op.rename_table('member_revision', 'package_group_revision')
    op.rename_table('member', 'package_group')