1e8d27922f56_create_price_table.py 926 B

123456789101112131415161718192021222324252627282930313233343536
  1. """create_price_table
  2. Revision ID: 1e8d27922f56
  3. Revises: 9254559dcac2
  4. Create Date: 2018-05-28 13:30:54.227839
  5. """
  6. from alembic import op
  7. import sqlalchemy as sa
  8. # revision identifiers, used by Alembic.
  9. revision = "1e8d27922f56"
  10. down_revision = "9254559dcac2"
  11. branch_labels = None
  12. depends_on = None
  13. def upgrade():
  14. # ### commands auto generated by Alembic - please adjust! ###
  15. op.create_table(
  16. "price",
  17. sa.Column("datetime", sa.DateTime(timezone=True), nullable=False),
  18. sa.Column("market_id", sa.Integer(), nullable=False),
  19. sa.Column("value", sa.Float(), nullable=False),
  20. sa.ForeignKeyConstraint(["market_id"], ["market.id"]),
  21. sa.PrimaryKeyConstraint("datetime", "market_id"),
  22. )
  23. # ### end Alembic commands ###
  24. def downgrade():
  25. # ### commands auto generated by Alembic - please adjust! ###
  26. op.drop_table("price")
  27. # ### end Alembic commands ###