Fix indentation in star migration.
This commit is contained in:
parent
aa4903c3cd
commit
08d84298e2
1 changed files with 18 additions and 22 deletions
|
@ -15,28 +15,24 @@ import sqlalchemy as sa
|
|||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('star',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=False),
|
||||
sa.Column('repository_id', sa.Integer(), nullable=False),
|
||||
sa.Column('created', sa.DateTime(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['repository_id'], ['repository.id'], name=op.f('fk_star_repository_id_repository')),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['user.id'], name=op.f('fk_star_user_id_user')),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_star'))
|
||||
)
|
||||
op.create_index('star_repository_id', 'star', ['repository_id'], unique=False)
|
||||
op.create_index('star_user_id', 'star', ['user_id'], unique=False)
|
||||
op.create_index('star_user_id_repository_id', 'star', ['user_id', 'repository_id'], unique=True)
|
||||
### end Alembic commands ###
|
||||
op.create_table('star',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=False),
|
||||
sa.Column('repository_id', sa.Integer(), nullable=False),
|
||||
sa.Column('created', sa.DateTime(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['repository_id'], ['repository.id'], name=op.f('fk_star_repository_id_repository')),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['user.id'], name=op.f('fk_star_user_id_user')),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_star'))
|
||||
)
|
||||
op.create_index('star_repository_id', 'star', ['repository_id'], unique=False)
|
||||
op.create_index('star_user_id', 'star', ['user_id'], unique=False)
|
||||
op.create_index('star_user_id_repository_id', 'star', ['user_id', 'repository_id'], unique=True)
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint('fk_star_repository_id_repository', 'star', type_='foreignkey')
|
||||
op.drop_constraint('fk_star_user_id_user', 'star', type_='foreignkey')
|
||||
op.drop_index('star_user_id_repository_id', table_name='star')
|
||||
op.drop_index('star_user_id', table_name='star')
|
||||
op.drop_index('star_repository_id', table_name='star')
|
||||
op.drop_table('star')
|
||||
### end Alembic commands ###
|
||||
op.drop_constraint('fk_star_repository_id_repository', 'star', type_='foreignkey')
|
||||
op.drop_constraint('fk_star_user_id_user', 'star', type_='foreignkey')
|
||||
op.drop_index('star_user_id_repository_id', table_name='star')
|
||||
op.drop_index('star_user_id', table_name='star')
|
||||
op.drop_index('star_repository_id', table_name='star')
|
||||
op.drop_table('star')
|
||||
|
|
Reference in a new issue