|
@@ -0,0 +1,242 @@
|
|
|
+"""empty message
|
|
|
+
|
|
|
+Revision ID: 7e912759589c
|
|
|
+Revises:
|
|
|
+Create Date: 2021-02-20 16:42:13.616735
|
|
|
+
|
|
|
+"""
|
|
|
+from alembic import op
|
|
|
+import sqlalchemy as sa
|
|
|
+
|
|
|
+
|
|
|
+# revision identifiers, used by Alembic.
|
|
|
+revision = '7e912759589c'
|
|
|
+down_revision = None
|
|
|
+branch_labels = None
|
|
|
+depends_on = None
|
|
|
+
|
|
|
+
|
|
|
+def upgrade():
|
|
|
+ # ### commands auto generated by Alembic - please adjust! ###
|
|
|
+ op.create_table('bacteria',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('tank_num', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('bean_valve',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('bottom_valve',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('tank_num', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('cargo1_disinfect',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('cargo2_disinfect',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('tank_num', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('color_machine',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('conveyor_belt1',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('conveyor_belt2',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('conveyor_belt3',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('dryer',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('heating',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('tank_num', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('hoist',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('peeling_machine',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('relay',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('tank_num', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('status', sa.Text(), nullable=False),
|
|
|
+ sa.Column('test4', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('stir',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('tank_num', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('tank_co2_sensor',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('tank_num', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('co2', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('tank_ph_sensor',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('tank_num', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('ph', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('tank_tem_sensor',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('tank_num', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('tem', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('temperature',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('tank_num', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('top_valve',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('tank_num', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('user',
|
|
|
+ sa.Column('userID', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('firstname', sa.String(length=30), nullable=False),
|
|
|
+ sa.Column('lastname', sa.String(length=30), nullable=False),
|
|
|
+ sa.Column('mail', sa.String(length=50), nullable=False),
|
|
|
+ sa.Column('phone', sa.String(length=20), nullable=False),
|
|
|
+ sa.Column('username', sa.String(length=30), nullable=False),
|
|
|
+ sa.Column('password', sa.String(length=40), nullable=False),
|
|
|
+ sa.Column('status', sa.Integer(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('userID'),
|
|
|
+ sa.UniqueConstraint('username')
|
|
|
+ )
|
|
|
+ op.create_table('wash_machine',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ op.create_table('water_injection',
|
|
|
+ sa.Column('sn', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('datetime', sa.DateTime(), nullable=False),
|
|
|
+ sa.Column('tank_num', sa.Integer(), nullable=False),
|
|
|
+ sa.Column('duration', sa.Text(), nullable=False),
|
|
|
+ sa.Column('start', sa.Text(), nullable=False),
|
|
|
+ sa.Column('end', sa.Text(), nullable=False),
|
|
|
+ sa.PrimaryKeyConstraint('sn')
|
|
|
+ )
|
|
|
+ # ### end Alembic commands ###
|
|
|
+
|
|
|
+
|
|
|
+def downgrade():
|
|
|
+ # ### commands auto generated by Alembic - please adjust! ###
|
|
|
+ op.drop_table('water_injection')
|
|
|
+ op.drop_table('wash_machine')
|
|
|
+ op.drop_table('user')
|
|
|
+ op.drop_table('top_valve')
|
|
|
+ op.drop_table('temperature')
|
|
|
+ op.drop_table('tank_tem_sensor')
|
|
|
+ op.drop_table('tank_ph_sensor')
|
|
|
+ op.drop_table('tank_co2_sensor')
|
|
|
+ op.drop_table('stir')
|
|
|
+ op.drop_table('relay')
|
|
|
+ op.drop_table('peeling_machine')
|
|
|
+ op.drop_table('hoist')
|
|
|
+ op.drop_table('heating')
|
|
|
+ op.drop_table('dryer')
|
|
|
+ op.drop_table('conveyor_belt3')
|
|
|
+ op.drop_table('conveyor_belt2')
|
|
|
+ op.drop_table('conveyor_belt1')
|
|
|
+ op.drop_table('color_machine')
|
|
|
+ op.drop_table('cargo2_disinfect')
|
|
|
+ op.drop_table('cargo1_disinfect')
|
|
|
+ op.drop_table('bottom_valve')
|
|
|
+ op.drop_table('bean_valve')
|
|
|
+ op.drop_table('bacteria')
|
|
|
+ # ### end Alembic commands ###
|