Y3S2-IoT/migrations/versions/40562f975781_updated_db.py

37 lines
945 B
Python
Raw Normal View History

2020-06-09 20:34:42 +00:00
"""Updated DB
Revision ID: 40562f975781
Revises:
Create Date: 2020-05-18 18:52:41.817526
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '40562f975781'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('sensor_data',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('humidity', sa.Float(), nullable=True),
sa.Column('avg_temp', sa.Float(), nullable=True),
sa.Column('baro_pressure', sa.Float(), nullable=True),
sa.Column('light', sa.Float(), nullable=True),
sa.Column('timestamp', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('sensor_data')
# ### end Alembic commands ###