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.

37 lines
1.0 KiB

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