"""add_atmo_company_table Revision ID: 3c8a8862c800 Revises: 981f62cc2cdb Create Date: 2025-07-12 01:28:26.221250 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '3c8a8862c800' down_revision = '981f62cc2cdb' branch_labels = None depends_on = None def upgrade(): """升级数据库到当前版本""" # ### commands auto generated by Alembic - please adjust! ### op.create_table('atmo_company', sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='污染源序号'), sa.Column('longitude', sa.Float(), nullable=True, comment='经度坐标(精确到小数点后六位)'), sa.Column('latitude', sa.Float(), nullable=True, comment='纬度坐标(精确到小数点后六位)'), sa.Column('company_name', sa.String(length=100), nullable=True, comment='企业名称'), sa.Column('company_type', sa.String(length=50), nullable=True, comment='企业类型'), sa.Column('county', sa.String(length=50), nullable=True, comment='所属区县'), sa.Column('particulate_emission', sa.Float(), nullable=True, comment='大气颗粒物排放量(吨/年)'), sa.PrimaryKeyConstraint('id') ) # ### end Alembic commands ### def downgrade(): """将数据库降级到上一版本""" # ### commands auto generated by Alembic - please adjust! ### op.drop_table('atmo_company') # ### end Alembic commands ###