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.

41 lines
1.3 KiB

  1. """empty message
  2. Revision ID: 643e9b785c28
  3. Revises: d1ab608c102a
  4. Create Date: 2018-11-24 23:31:37.923248
  5. """
  6. from alembic import op
  7. import sqlalchemy as sa
  8. # revision identifiers, used by Alembic.
  9. revision = '643e9b785c28'
  10. down_revision = 'd1ab608c102a'
  11. branch_labels = None
  12. depends_on = None
  13. def upgrade():
  14. # ### commands auto generated by Alembic - please adjust! ###
  15. op.create_table('comments',
  16. sa.Column('id', sa.Integer(), nullable=False),
  17. sa.Column('body', sa.Text(), nullable=True),
  18. sa.Column('body_html', sa.Text(), nullable=True),
  19. sa.Column('timestamp', sa.DateTime(), nullable=True),
  20. sa.Column('disabled', sa.Boolean(), nullable=True),
  21. sa.Column('author_id', sa.Integer(), nullable=True),
  22. sa.Column('post_id', sa.Integer(), nullable=True),
  23. sa.ForeignKeyConstraint(['author_id'], ['users.id'], ),
  24. sa.ForeignKeyConstraint(['post_id'], ['posts.id'], ),
  25. sa.PrimaryKeyConstraint('id')
  26. )
  27. op.create_index(op.f('ix_comments_timestamp'), 'comments', ['timestamp'], unique=False)
  28. # ### end Alembic commands ###
  29. def downgrade():
  30. # ### commands auto generated by Alembic - please adjust! ###
  31. op.drop_index(op.f('ix_comments_timestamp'), table_name='comments')
  32. op.drop_table('comments')
  33. # ### end Alembic commands ###