1234567891011121314151617181920212223242526272829303132333435363738 |
- """add_EffCd_ouput_table
- Revision ID: 95832ecc0bdc
- Revises: 8fc3bbb11ff3
- Create Date: 2025-07-12 00:58:46.794605
- """
- from alembic import op
- import sqlalchemy as sa
- # revision identifiers, used by Alembic.
- revision = '95832ecc0bdc'
- down_revision = '8fc3bbb11ff3'
- branch_labels = None
- depends_on = None
- def upgrade():
- """升级数据库到当前版本"""
- # ### commands auto generated by Alembic - please adjust! ###
- op.create_table('EffCd_output_data',
- sa.Column('ID', sa.Integer(), autoincrement=True, nullable=False, comment='自增主键'),
- sa.Column('Farmland_ID', sa.Integer(), nullable=False, comment='关联农地ID'),
- sa.Column('Sample_ID', sa.Integer(), nullable=False, comment='关联样点ID'),
- sa.Column('LnEffCd', sa.Float(), nullable=False, comment='有效态镉浓度的自然对数值[ln(mg/kg)]'),
- sa.ForeignKeyConstraint(['Farmland_ID', 'Sample_ID'], ['Farmland_data.Farmland_ID', 'Farmland_data.Sample_ID'], ),
- sa.PrimaryKeyConstraint('ID'),
- comment='有效态镉预测模型输出数据'
- )
- # ### end Alembic commands ###
- def downgrade():
- """将数据库降级到上一版本"""
- # ### commands auto generated by Alembic - please adjust! ###
- op.drop_table('EffCd_output_data')
- # ### end Alembic commands ###
|