Upload project.

This commit is contained in:
StevenJW
2020-06-09 21:34:42 +01:00
parent b28b77a1ed
commit b873632828
22 changed files with 743 additions and 0 deletions

View 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 ###

View 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 ###