Add support for metadata on robot accounts
Fixes https://jira.coreos.com/browse/QUAY-847 Fixes https://jira.coreos.com/browse/QUAY-816
This commit is contained in:
parent
a693771345
commit
254cdfe43a
8 changed files with 229 additions and 52 deletions
|
@ -0,0 +1,35 @@
|
|||
"""Add RobotAccountMetadata table
|
||||
|
||||
Revision ID: b547bc139ad8
|
||||
Revises: 0cf50323c78b
|
||||
Create Date: 2018-03-09 15:50:48.298880
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b547bc139ad8'
|
||||
down_revision = '0cf50323c78b'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from util.migrate import UTF8CharField
|
||||
|
||||
|
||||
def upgrade(tables):
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('robotaccountmetadata',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('robot_account_id', sa.Integer(), nullable=False),
|
||||
sa.Column('description', UTF8CharField(length=255), nullable=False),
|
||||
sa.Column('unstructured_json', sa.Text(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['robot_account_id'], ['user.id'], name=op.f('fk_robotaccountmetadata_robot_account_id_user')),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_robotaccountmetadata'))
|
||||
)
|
||||
op.create_index('robotaccountmetadata_robot_account_id', 'robotaccountmetadata', ['robot_account_id'], unique=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('robotaccountmetadata')
|
||||
# ### end Alembic commands ###
|
Reference in a new issue