"""add_parameter_table Revision ID: 3f2e574cefad Revises: 92ec1d480a3c Create Date: 2025-07-11 15:29:01.868419 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '3f2e574cefad' down_revision = '92ec1d480a3c' branch_labels = None depends_on = None def upgrade(): """升级数据库到当前版本""" # ### commands auto generated by Alembic - please adjust! ### op.create_table('Parameters', sa.Column('ID', sa.Integer(), autoincrement=True, nullable=False), sa.Column('F1', sa.Float(), nullable=True, comment='活性SOM的占比系数'), sa.Column('F2', sa.Float(), nullable=True, comment='HA占比系数'), sa.Column('F3', sa.Float(), nullable=True, comment='氮肥镉含量平均值(mg/kg)'), sa.Column('F4', sa.Float(), nullable=True, comment='磷肥镉含量平均值(mg/kg)'), sa.Column('F5', sa.Float(), nullable=True, comment='钾肥镉含量平均值(mg/kg)'), sa.Column('F6', sa.Float(), nullable=True, comment='复合肥镉含量平均值(mg/kg)'), sa.Column('F7', sa.Float(), nullable=True, comment='有机肥镉含量平均值(mg/kg)'), sa.Column('F8', sa.Float(), nullable=True, comment='农药镉含量(mg/kg)'), sa.Column('F9', sa.Float(), nullable=True, comment='农家肥镉含量(mg/kg)'), sa.Column('F10', sa.Float(), nullable=True, comment='农膜镉含量(mg/kg)'), sa.Column('F11', sa.Float(), nullable=True, comment='作物亩产量(斤)'), sa.Column('NF', sa.Float(), nullable=True, comment='氮肥单位面积使用量(t/ha/a)'), sa.Column('PF', sa.Float(), nullable=True, comment='磷肥单位面积使用量(t/ha/a)'), sa.Column('KF', sa.Float(), nullable=True, comment='钾肥单位面积使用量(t/ha/a)'), sa.Column('CF', sa.Float(), nullable=True, comment='复合肥单位面积使用量(t/ha/a)'), sa.Column('OF', sa.Float(), nullable=True, comment='有机肥单位面积使用量(t/ha/a)'), sa.Column('P', sa.Float(), nullable=True, comment='农药单位面积使用量(t/ha/a)'), sa.Column('FF', sa.Float(), nullable=True, comment='农家肥单位面积使用量(t/ha/a)'), sa.Column('AF', sa.Float(), nullable=True, comment='农膜(存留)单位面积使用量(t/ha/a)'), sa.Column('Area', sa.String(length=50), nullable=True, comment='地区'), sa.PrimaryKeyConstraint('ID') ) # ### end Alembic commands ### def downgrade(): """将数据库降级到上一版本""" # ### commands auto generated by Alembic - please adjust! ### op.drop_table('Parameters') # ### end Alembic commands ###