Upload project.
This commit is contained in:
36
migrations/versions/40562f975781_updated_db.py
Normal file
36
migrations/versions/40562f975781_updated_db.py
Normal file
@@ -0,0 +1,36 @@
|
||||
"""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 ###
|
||||
28
migrations/versions/b9900a0f475d_tweaks.py
Normal file
28
migrations/versions/b9900a0f475d_tweaks.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""Tweaks
|
||||
|
||||
Revision ID: b9900a0f475d
|
||||
Revises: 40562f975781
|
||||
Create Date: 2020-05-22 20:02:25.542693
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'b9900a0f475d'
|
||||
down_revision = '40562f975781'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('sensor_data', sa.Column('danger_level', sa.Integer(), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('sensor_data', 'danger_level')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user