Comment system for Hugo
https://labertasche.tuxstash.de/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
2.5 KiB
56 lines
2.5 KiB
"""empty message
|
|
|
|
Revision ID: 3f3046e1c83c
|
|
Revises:
|
|
Create Date: 2020-12-07 21:57:21.057956
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '3f3046e1c83c'
|
|
down_revision = None
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('t_comments', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('project_id', sa.Integer(), nullable=False, default=1))
|
|
batch_op.create_unique_constraint(batch_op.f('uq_t_comments_content'), ['content'])
|
|
batch_op.create_foreign_key(batch_op.f('fk_t_comments_project_id_t_projects'), 't_projects', ['project_id'], ['id_project'])
|
|
|
|
with op.batch_alter_table('t_email', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('project_id', sa.Integer(), nullable=False, default=1))
|
|
batch_op.create_unique_constraint(batch_op.f('uq_t_email_email'), ['email'])
|
|
batch_op.create_foreign_key(batch_op.f('fk_t_email_project_id_t_projects'), 't_projects', ['project_id'], ['id_project'])
|
|
|
|
with op.batch_alter_table('t_location', schema=None) as batch_op:
|
|
batch_op.add_column(sa.Column('project_id', sa.Integer(), nullable=False, default=1))
|
|
batch_op.create_unique_constraint(batch_op.f('uq_t_location_location'), ['location'])
|
|
batch_op.create_foreign_key(batch_op.f('fk_t_location_project_id_t_projects'), 't_projects', ['project_id'], ['id_project'])
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('t_location', schema=None) as batch_op:
|
|
batch_op.drop_constraint(batch_op.f('fk_t_location_project_id_t_projects'), type_='foreignkey')
|
|
batch_op.drop_constraint(batch_op.f('uq_t_location_location'), type_='unique')
|
|
batch_op.drop_column('project_id')
|
|
|
|
with op.batch_alter_table('t_email', schema=None) as batch_op:
|
|
batch_op.drop_constraint(batch_op.f('fk_t_email_project_id_t_projects'), type_='foreignkey')
|
|
batch_op.drop_constraint(batch_op.f('uq_t_email_email'), type_='unique')
|
|
batch_op.drop_column('project_id')
|
|
|
|
with op.batch_alter_table('t_comments', schema=None) as batch_op:
|
|
batch_op.drop_constraint(batch_op.f('fk_t_comments_project_id_t_projects'), type_='foreignkey')
|
|
batch_op.drop_constraint(batch_op.f('uq_t_comments_content'), type_='unique')
|
|
batch_op.drop_column('project_id')
|
|
|
|
# ### end Alembic commands ###
|
|
|