"""add_river_cross_section Revision ID: a2cfbc6c2673 Revises: e484105cc893 Create Date: 2025-07-12 01:35:26.959660 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'a2cfbc6c2673' down_revision = 'e484105cc893' branch_labels = None depends_on = None def upgrade(): """升级数据库到当前版本""" # ### commands auto generated by Alembic - please adjust! ### op.create_table('cross_section', sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键ID'), sa.Column('river_name', sa.String(length=50), nullable=False, comment='所属河流'), sa.Column('position', sa.String(length=100), nullable=False, comment='断面位置'), sa.Column('county', sa.String(length=50), nullable=False, comment='所属行政区'), sa.Column('longitude', sa.Float(), nullable=False, comment='经度坐标(精确到小数点后六位数)'), sa.Column('latitude', sa.Float(), nullable=False, comment='纬度坐标(精确到小数点后六位数)'), sa.Column('cd_concentration', sa.Float(), nullable=False, comment='镉浓度(mg/L)'), sa.PrimaryKeyConstraint('id') ) # ### end Alembic commands ### def downgrade(): """将数据库降级到上一版本""" # ### commands auto generated by Alembic - please adjust! ### op.drop_table('cross_section') # ### end Alembic commands ###