37 lines
945 B
Python
37 lines
945 B
Python
|
"""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 ###
|