12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- """add_atmo_sample_table
- Revision ID: 981f62cc2cdb
- Revises: f4e275af56c7
- Create Date: 2025-07-12 01:23:24.811627
- """
- from alembic import op
- import sqlalchemy as sa
- # revision identifiers, used by Alembic.
- revision = '981f62cc2cdb'
- down_revision = 'f4e275af56c7'
- branch_labels = None
- depends_on = None
- def upgrade():
- """升级数据库到当前版本"""
- # ### commands auto generated by Alembic - please adjust! ###
- op.create_table('Atmo_sample_data',
- sa.Column('ID', sa.String(length=50), nullable=False, comment='采样点ID'),
- sa.Column('longitude', sa.Float(), nullable=True, comment='经度坐标(精确到小数点后六位)'),
- sa.Column('latitude', sa.Float(), nullable=True, comment='纬度坐标(精确到小数点后六位)'),
- sa.Column('sampling_location', sa.String(length=100), nullable=True, comment='采样地点'),
- sa.Column('start_time', sa.String(length=20), nullable=True, comment='采样开始时间(精确到秒)'),
- sa.Column('end_time', sa.String(length=20), nullable=True, comment='采样结束时间(精确到秒)'),
- sa.Column('cumulative_time', sa.String(length=10), nullable=True, comment='累计采样时长'),
- sa.Column('average_flow_rate', sa.Float(), nullable=True, comment='平均流量(L/min)'),
- sa.Column('cumulative_true_volume', sa.Float(), nullable=True, comment='实况采样体积(L)'),
- sa.Column('cumulative_standard_volume', sa.Float(), nullable=True, comment='标准采样体积(L)'),
- sa.Column('sample_type', sa.String(length=50), nullable=True, comment='样品类型'),
- sa.Column('sample_name', sa.String(length=50), nullable=True, comment='样品名称'),
- sa.Column('Cr_particulate', sa.Float(), nullable=True, comment='Cr含量(mg/kg)'),
- sa.Column('As_particulate', sa.Float(), nullable=True, comment='As含量(mg/kg)'),
- sa.Column('Cd_particulate', sa.Float(), nullable=True, comment='Cd含量(mg/kg)'),
- sa.Column('Hg_particulate', sa.Float(), nullable=True, comment='Hg含量(mg/kg)'),
- sa.Column('Pb_particulate', sa.Float(), nullable=True, comment='Pb含量(mg/kg)'),
- sa.Column('particle_weight', sa.Float(), nullable=True, comment='颗粒物重量(mg)'),
- sa.Column('standard_volume', sa.Float(), nullable=True, comment='标准体积(m³)'),
- sa.Column('particle_concentration', sa.Float(), nullable=True, comment='颗粒物浓度(μg/m³)'),
- sa.Column('sample_code', sa.String(length=20), nullable=True, comment='样品编码'),
- sa.Column('temperature', sa.Float(), nullable=True, comment='温度(℃)'),
- sa.Column('pressure', sa.Float(), nullable=True, comment='气压(kPa)'),
- sa.Column('humidity', sa.Float(), nullable=True, comment='湿度(%)'),
- sa.Column('wind_speed', sa.Float(), nullable=True, comment='风速(m/s)'),
- sa.Column('wind_direction', sa.String(length=20), nullable=True, comment='风向'),
- sa.PrimaryKeyConstraint('ID')
- )
- # ### end Alembic commands ###
- def downgrade():
- """将数据库降级到上一版本"""
- # ### commands auto generated by Alembic - please adjust! ###
- op.drop_table('Atmo_sample_data')
- # ### end Alembic commands ###
|