Commit 095d4236 by dong

满城项目第一次提交

parent b1c0e280
# 太原招商图谱项目
# 满城招商图谱项目
# 如果找不到models,就在启动文件引入
# from apps.models import *
......
......@@ -61,7 +61,7 @@ def creat_app(config_name):
# 域名
global SERVER_NAME
SERVER_NAME = 'https://jincheng.industrychain.online'
SERVER_NAME = 'https://mancheng.industrychain.online'
# 绑定SQLAlchemy的app对象
db.init_app(app)
......@@ -72,7 +72,7 @@ def creat_app(config_name):
# 初始化redis工具,创建Redis连接对象用于缓存
global redis_store
redis_store = redis.StrictRedis(host=config_class.REDIS_HOST, port=config_class.REDIS_PORT,
db=2, password=config_class.REDIS_PASS)
db=10, password=config_class.REDIS_PASS)
# cors跨域插件,是否允许发送cookies
CORS(app, resources=r'/*')
......
......@@ -515,7 +515,6 @@ def search_project():
SikuProject.flag >= flag if flag else text(''), # 线索库包含所有阶段的项目
SikuProject.is_delete == 0,
SikuProject.project_to_area == user_district if flag in [2, 3, 4] and user_district != '晋城市' else text(''),
# SikuProject.project_to_area1 == user_district if flag in [3, 4] and user_district != '晋城市' else text(''),
SikuProject.distribute_condition.in_(distribute_condition_list) if distribute_condition_list
else SikuProject.distribute_condition == distribute_condition if distribute_condition else text(''),
SikuProject.project_name.like('%{}%'.format(project_name)) if project_name else text(''),
......
import datetime
import pymysql
import requests
from lxml import etree
db = pymysql.connect(host='rm-8vbn50m65w332c23aso.mysql.zhangbei.rds.aliyuncs.com',
user='root',
password='Root@2020',
db='jincheng_data',
charset='utf8')
cur = db.cursor()
current_time = datetime.datetime.now()
def data_notification():
page_html_list = [
"index.shtml", # 首页
"index_1.shtml", # 第2页
"index_2.shtml", # 第3页
"index_3.shtml", # 第4页
"index_4.shtml", # 第5页
"index_5.shtml", # 第6页
"index_6.shtml", # 第7页
]
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54'}
data_list = []
for page_index in page_html_list:
url = "http://zsj.jcgov.gov.cn/sjtb/sjtb/{}".format(page_index)
try:
respose = requests.get(url, headers=headers)
respose.encoding = 'utf-8'
html_etree = ''
if respose.status_code == 200:
html_etree = etree.HTML(respose.text)
content_name_list = html_etree.xpath('//div[@class="newslist newslistdixx"]//span[@class="list_newstitle"]/a/text()')
content_url_list = html_etree.xpath('//div[@class="newslist newslistdixx"]//span[@class="list_newstitle"]/a/@href')
time_list = html_etree.xpath('//div[@class="newslist newslistdixx"]//span[2]/text()')
i = 0
for content_name in content_name_list:
content_url = content_url_list[i].replace("./", 'http://zsj.jcgov.gov.cn/sjtb/sjtb/'),
respose = requests.get(content_url[0], headers=headers)
respose.encoding = 'utf-8'
html_etree1 = ''
if respose.status_code == 200:
html_etree1 = etree.HTML(respose.text)
content = html_etree1.xpath('//table[1]')[2]
result = etree.tostring(content, encoding='utf-8').decode()
data_dic = {
"content_name": content_name,
# "content_url": content_url_list[i].replace('./', 'http://zsj.jcgov.gov.cn/sjtb/sjtb/'),
"content": result,
"time": time_list[i][1:-1]
}
data_list.append(data_dic)
i += 1
continue
continue
except Exception as e:
print("数据库错误", e)
# 存入数据库
i = 0
j = 0
add_list = []
for data in data_list:
content_name = data['content_name']
sql = "SELECT name FROM investment_information WHERE flag=2 and name='{}';".format(content_name)
cur.execute(sql)
name = cur.fetchone()
if name:
j += 1
continue
name = data['content_name']
flag = 2
content = data['content']
source = '晋城市投资促进中心'
time = data['time']
sql = "INSERT INTO investment_information(name, flag, time, source, content) VALUES ('{}', '{}', '{}', '{}', '{}');".format(name, flag, time, source, content)
cur.execute(sql)
db.commit()
add_list.append(name)
i += 1
if add_list:
print(current_time, "数据通报原有数据{}条,今日新增{}条,分别为{}".format(j, i, add_list))
else:
print(current_time, "数据通报原有数据{}条,今日新增{}条!".format(j, i))
def work_trend():
page_html_list = ["index.shtml"]
for i in range(1, 25):
html_index = 'index_{}.shtml'.format(i)
page_html_list.append(html_index)
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54'}
data_list = []
for page_index in page_html_list:
url = "http://zsj.jcgov.gov.cn/xwdt/zhxx/{}".format(page_index)
try:
html_etree = ''
respose = requests.get(url, headers=headers)
respose.encoding = 'utf-8'
if respose.status_code == 200:
html_etree = etree.HTML(respose.text)
content_name_list = html_etree.xpath('//div[@class="newslist newslistdixx"]//span[@class="list_newstitle"]/a/text()')
content_url_list = html_etree.xpath('//div[@class="newslist newslistdixx"]//span[@class="list_newstitle"]/a/@href')
time_list = html_etree.xpath('//div[@class="newslist newslistdixx"]//span[2]/text()')
i = 0
for content_name in content_name_list:
content_url = content_url_list[i].replace('./', 'http://zsj.jcgov.gov.cn/xwdt/zhxx/')
content_html = requests.get(content_url, headers=headers)
content_html.encoding = 'utf-8'
if content_html.status_code == 200:
html_etree1 = etree.HTML(content_html.text)
if content_name == "《晋城市招商引资十条优惠政策实施细则》解读":
handeled_html_str = etree.tostring(html_etree1).decode()
print(handeled_html_str)
# content_info_list = html_etree1.xpath(
# '//div[@class="view TRS_UEDITOR trs_paper_default trs_web"]/p/text()')
content_info_list = html_etree1.xpath(
'//div[@class="view TRS_UEDITOR trs_paper_default trs_web"]//text()')
if not content_info_list:
content_info_list = html_etree1.xpath(
'//div[@class="view TRS_UEDITOR trs_paper_default trs_word trs_web"]//text()')
if not content_info_list:
content_info_list = html_etree1.xpath(
'//div[@class="view TRS_UEDITOR trs_paper_default"]//@href')
if content_info_list and content_info_list[0].startswith('./'):
content_info_list = [
'请复制链接到浏览器查看:' + 'http://zsj.jcgov.gov.cn/xwdt/zhxx/202301/' + content_info_list[
0].replace('./', '')]
if content_info_list and content_info_list[0].startswith('http'):
content_info_list = ['请复制链接到浏览器查看:' + content_info_list[0]]
content_info1 = ''
for content_info in content_info_list:
content_info1 = content_info1 + '<br>' + content_info
data_dic = {
"content_name": content_name,
"content_info": content_info1,
"time": time_list[i][1:-1]
}
data_list.append(data_dic)
i += 1
continue
continue
except Exception as e:
print("数据库错误", e)
# # 存入数据库
i = 0
j = 0
add_list = []
for data in data_list:
content_name = data['content_name']
# name = data['content_name']
flag = 1
time = data['time']
source = '晋城市投资促进中心'
content = data['content_info']
sql = "SELECT name FROM investment_information WHERE flag=1 and name='{}';".format(content_name)
cur.execute(sql)
name = cur.fetchone()
if name:
j += 1
sql = "UPDATE investment_information SET time='{}', content='{}' WHERE name='{}';".format(time, content, content_name)
cur.execute(sql)
db.commit()
continue
# name = data['content_name']
# flag = 1
# time = data['time']
# source = '晋城市投资促进中心'
# content = data['content_info']
sql = "INSERT INTO investment_information(name, flag, time, source, content) VALUES('{}', '{}', '{}', '{}', '{}');".format(content_name, flag, time, source, content)
cur.execute(sql)
db.commit()
add_list.append(content_name)
i += 1
if add_list:
print(current_time, "工作动态原有数据{}条,今日新增{}条,分别为{}".format(j, i, add_list))
else:
print(current_time, "工作动态原有数据{}条,今日新增{}条!".format(j, i))
if __name__ == '__main__':
data_notification()
work_trend()
......@@ -8,12 +8,12 @@ from urllib import parse
class Config:
# sql数据库
# 在连接前将特殊的密码转码再链接即可
passowrd = parse.quote_plus('devzysf#!241!668')
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://zysfdev:{}@rm-8vbn50m65w332c23aso.mysql.zhangbei.rds.aliyuncs.com/" \
"jincheng_data?charset=utf8mb4".format(passowrd) # 晋城 阿里云
# passowrd = parse.quote_plus('Root@2020')
# SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:{}@rm-8vbn50m65w332c23aso.mysql.zhangbei.rds.aliyuncs.com/" \
# "jincheng_data?charset=utf8mb4".format(passowrd) # 晋城 阿里云
# passowrd = parse.quote_plus('devzysf#!241!668')
# SQLALCHEMY_DATABASE_URI = "mysql+pymysql://zysfdev:{}@rm-8vbn50m65w332c23aso.mysql.zhangbei.rds.aliyuncs.com/" \
# "mancheng?charset=utf8mb4".format(passowrd) # 晋城 阿里云
passowrd = parse.quote_plus('Root@2020')
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:{}@rm-8vbn50m65w332c23aso.mysql.zhangbei.rds.aliyuncs.com/" \
"mancheng?charset=utf8mb4".format(passowrd) # 晋城 阿里云
SQLALCHEMY_TRACK_MODIFICATIONS = False
......@@ -39,6 +39,7 @@ class Config:
SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT, password=REDIS_PASS)
SESSION_USE_SIGNER = True
# 对session_id进行隐藏处理
# PREMANENT_SESSION_LIFETIME = 60 # 整数表示秒
# 设置session的有效时间
# PREMANENT_SESSION_LIFETIME = datetime.timedelta(hours=1)
......
"""empty message
Revision ID: 0440b17fefaa
Revises: d1f1ec828b23
Create Date: 2022-03-08 18:06:14.069161
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0440b17fefaa'
down_revision = 'd1f1ec828b23'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('government_organization',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('pnums', sa.Integer(), nullable=True, comment='人数'),
sa.Column('charge', sa.String(length=20), nullable=True, comment='机构负责人'),
sa.Column('charge_phone', sa.String(length=20), nullable=True, comment='负责人电话'),
sa.Column('function', sa.Text(), nullable=True, comment='部门职能'),
sa.Column('name', sa.String(length=30), nullable=True, comment='新增时间'),
sa.Column('add_person', sa.String(length=20), nullable=True, comment='新增人'),
sa.Column('add_time', sa.DateTime(), nullable=True, comment='新增时间'),
sa.Column('edit_person', sa.String(length=20), nullable=True, comment='编辑人'),
sa.Column('edit_time', sa.DateTime(), nullable=True, comment='编辑时间'),
sa.PrimaryKeyConstraint('id')
)
op.create_table('government_department',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('pnums', sa.Integer(), nullable=True, comment='人数'),
sa.Column('charge', sa.String(length=255), nullable=True, comment='部门负责人'),
sa.Column('charge_phone', sa.String(length=255), nullable=True, comment='负责人电话'),
sa.Column('function', sa.Text(), nullable=True, comment='负责人电话'),
sa.Column('name', sa.String(length=255), nullable=False, comment='政府机构部门名称'),
sa.Column('goverment_org_id', sa.Integer(), nullable=True, comment='外键id,机构id'),
sa.ForeignKeyConstraint(['goverment_org_id'], ['government_organization.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('government_department')
op.drop_table('government_organization')
# ### end Alembic commands ###
"""empty message
Revision ID: 08c109f72e57
Revises: bbe194dda5cc
Create Date: 2022-11-15 16:49:23.872587
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '08c109f72e57'
down_revision = 'bbe194dda5cc'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('siku_project', sa.Column('flag', sa.Integer(), nullable=True, comment='1为线索库,2为对接库,3为签约库,4为开工库'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('siku_project', 'flag')
# ### end Alembic commands ###
"""empty message
Revision ID: 0a26b9ded8ca
Revises: c04177a30f4a
Create Date: 2023-02-14 09:58:23.220157
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '0a26b9ded8ca'
down_revision = 'c04177a30f4a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('industry_chain', sa.Column('chain_id', sa.Integer(), nullable=True, comment='关系id(关联哪个产业链'))
op.alter_column('industry_chain', 'relate_id',
existing_type=mysql.INTEGER(display_width=11),
comment='关系id(关联哪个产业环节',
existing_comment='关系id(关联与哪个产业环节',
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('industry_chain', 'relate_id',
existing_type=mysql.INTEGER(display_width=11),
comment='关系id(关联与哪个产业环节',
existing_comment='关系id(关联哪个产业环节',
existing_nullable=True)
op.drop_column('industry_chain', 'chain_id')
# ### end Alembic commands ###
"""empty message
Revision ID: 0aa5a0f4e755
Revises: 4ff348e88f11
Create Date: 2023-02-22 14:25:27.882298
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '0aa5a0f4e755'
down_revision = '4ff348e88f11'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('carrier_build', sa.Column('builde_type', sa.String(length=20), nullable=True, comment='楼宇类型(商铺/写字楼/其他)'))
op.drop_column('carrier_build', 'buide_type')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('carrier_build', sa.Column('buide_type', mysql.VARCHAR(length=20), nullable=True, comment='楼宇类型(商铺/写字楼/其他)'))
op.drop_column('carrier_build', 'builde_type')
# ### end Alembic commands ###
"""empty message
Revision ID: 0aad01ae0dda
Revises: d54ab46ad83a
Create Date: 2022-11-16 17:23:10.465454
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0aad01ae0dda'
down_revision = 'd54ab46ad83a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('joint_img', sa.Column('project_id', sa.Integer(), nullable=True, comment='外键id,项目id'))
op.create_foreign_key(None, 'joint_img', 'siku_project', ['project_id'], ['id'])
op.add_column('progress_condition', sa.Column('project_id', sa.Integer(), nullable=True, comment='外键id,项目id'))
op.create_foreign_key(None, 'progress_condition', 'siku_project', ['project_id'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'progress_condition', type_='foreignkey')
op.drop_column('progress_condition', 'project_id')
op.drop_constraint(None, 'joint_img', type_='foreignkey')
op.drop_column('joint_img', 'project_id')
# ### end Alembic commands ###
"""create table
Revision ID: 0d39b971db58
Revises: 39f0cd363bb8
Create Date: 2021-12-02 16:28:53.786687
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '0d39b971db58'
down_revision = '39f0cd363bb8'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('city', 'create_time',
existing_type=mysql.DATETIME(),
comment='创建时间',
existing_nullable=True)
op.alter_column('city', 'update_time',
existing_type=mysql.DATETIME(),
comment='更新时间',
existing_nullable=True)
op.alter_column('examine', 'create_time',
existing_type=mysql.DATETIME(),
comment='创建时间',
existing_nullable=True)
op.alter_column('examine', 'update_time',
existing_type=mysql.DATETIME(),
comment='更新时间',
existing_nullable=True)
op.alter_column('newproject', 'create_time',
existing_type=mysql.DATETIME(),
comment='创建时间',
existing_nullable=True)
op.alter_column('newproject', 'update_time',
existing_type=mysql.DATETIME(),
comment='更新时间',
existing_nullable=True)
op.alter_column('project', 'create_time',
existing_type=mysql.DATETIME(),
comment='创建时间',
existing_nullable=True)
op.alter_column('project', 'update_time',
existing_type=mysql.DATETIME(),
comment='更新时间',
existing_nullable=True)
op.create_table_comment(
'project',
'招商驾驶舱-重点招商项目表',
existing_comment='招商驾驶舱-重点项目表',
schema=None
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table_comment(
'project',
'招商驾驶舱-重点项目表',
existing_comment='招商驾驶舱-重点招商项目表',
schema=None
)
op.alter_column('project', 'update_time',
existing_type=mysql.DATETIME(),
comment=None,
existing_comment='更新时间',
existing_nullable=True)
op.alter_column('project', 'create_time',
existing_type=mysql.DATETIME(),
comment=None,
existing_comment='创建时间',
existing_nullable=True)
op.alter_column('newproject', 'update_time',
existing_type=mysql.DATETIME(),
comment=None,
existing_comment='更新时间',
existing_nullable=True)
op.alter_column('newproject', 'create_time',
existing_type=mysql.DATETIME(),
comment=None,
existing_comment='创建时间',
existing_nullable=True)
op.alter_column('examine', 'update_time',
existing_type=mysql.DATETIME(),
comment=None,
existing_comment='更新时间',
existing_nullable=True)
op.alter_column('examine', 'create_time',
existing_type=mysql.DATETIME(),
comment=None,
existing_comment='创建时间',
existing_nullable=True)
op.alter_column('city', 'update_time',
existing_type=mysql.DATETIME(),
comment=None,
existing_comment='更新时间',
existing_nullable=True)
op.alter_column('city', 'create_time',
existing_type=mysql.DATETIME(),
comment=None,
existing_comment='创建时间',
existing_nullable=True)
# ### end Alembic commands ###
"""empty message
Revision ID: 0faa9eac099f
Revises: 480d44ac277f
Create Date: 2022-12-29 11:02:35.440057
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '0faa9eac099f'
down_revision = '480d44ac277f'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('industry_distribute',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('industry_name', sa.String(length=20), nullable=True, comment='行业名称'),
sa.Column('industry_num', sa.Integer(), nullable=True, comment='个数'),
sa.Column('investment_volume', sa.Float(), nullable=True, comment='投资额(亿元)'),
sa.PrimaryKeyConstraint('id'),
comment='招商驾驶舱开工项目产业分布数据'
)
op.drop_table('industrydistribute')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('industrydistribute',
sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('industry_name', mysql.VARCHAR(length=20), nullable=True, comment='行业名称'),
sa.Column('industry_num', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='个数'),
sa.Column('investment_volume', mysql.FLOAT(), nullable=True, comment='投资额(亿元)'),
sa.PrimaryKeyConstraint('id'),
comment='招商驾驶舱开工项目产业分布数据',
mysql_comment='招商驾驶舱开工项目产业分布数据',
mysql_default_charset='utf8',
mysql_engine='InnoDB'
)
op.drop_table('industry_distribute')
# ### end Alembic commands ###
"""empty message
Revision ID: 10b496f3dd09
Revises: 168328e24456
Create Date: 2022-11-24 17:38:27.548876
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '10b496f3dd09'
down_revision = '168328e24456'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('shanxi_target', sa.Column('is_delete', sa.Integer(), nullable=True, comment='逻辑删除'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('shanxi_target', 'is_delete')
# ### end Alembic commands ###
"""empty message
Revision ID: 1148aa49cc24
Revises: 6552335d82e5
Create Date: 2023-02-22 17:25:36.429391
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '1148aa49cc24'
down_revision = '6552335d82e5'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('carrier_factory', sa.Column('inside_picture_url', sa.String(length=255), nullable=True, comment='内部照片url'))
op.add_column('carrier_factory', sa.Column('outer_picture_url', sa.String(length=255), nullable=True, comment='外部照片url'))
op.alter_column('carrier_factory', 'price_url',
existing_type=mysql.VARCHAR(length=255),
comment='平面图url',
existing_comment='厂房图片url',
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('carrier_factory', 'price_url',
existing_type=mysql.VARCHAR(length=255),
comment='厂房图片url',
existing_comment='平面图url',
existing_nullable=True)
op.drop_column('carrier_factory', 'outer_picture_url')
op.drop_column('carrier_factory', 'inside_picture_url')
# ### end Alembic commands ###
"""empty message
Revision ID: 12cd8a15569b
Revises: 1a74bd87ca85
Create Date: 2023-03-09 18:11:45.464796
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '12cd8a15569b'
down_revision = '1a74bd87ca85'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('company', sa.Column('register_org', sa.String(length=100), nullable=True, comment='登记机关'))
op.add_column('enterprise', sa.Column('register_org', sa.String(length=100), nullable=True, comment='登记机关'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('enterprise', 'register_org')
op.drop_column('company', 'register_org')
# ### end Alembic commands ###
"""empty message
Revision ID: 168328e24456
Revises: 5faec18e77e2
Create Date: 2022-11-24 11:55:32.945235
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '168328e24456'
down_revision = '5faec18e77e2'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('shanxi_target', 'file_name')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('shanxi_target', sa.Column('file_name', mysql.VARCHAR(length=30), nullable=True, comment='文件名称'))
# ### end Alembic commands ###
"""empty message
Revision ID: 16fd9d84e92d
Revises: 6ab647f6d851
Create Date: 2023-02-23 16:56:07.078864
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '16fd9d84e92d'
down_revision = '6ab647f6d851'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('user_build',
sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('build_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['build_id'], ['carrier_build.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('user_id', 'build_id')
)
op.create_table('user_factory',
sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('factory_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['factory_id'], ['carrier_factory.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('user_id', 'factory_id')
)
op.create_table('user_land',
sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('land_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['land_id'], ['carrier_land.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('user_id', 'land_id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('user_land')
op.drop_table('user_factory')
op.drop_table('user_build')
# ### end Alembic commands ###
"""create table
Revision ID: 1892550a14e5
Revises: 228d82192bf7
Create Date: 2021-12-02 15:07:54.976612
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1892550a14e5'
down_revision = '228d82192bf7'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table_comment(
'enterprise',
'全国企业',
existing_comment='压测资源表',
schema=None
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table_comment(
'enterprise',
'压测资源表',
existing_comment='全国企业',
schema=None
)
# ### end Alembic commands ###
"""empty message
Revision ID: 19ac0d1f0f55
Revises: 3aae2e3789ac
Create Date: 2023-02-03 10:09:38.818775
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '19ac0d1f0f55'
down_revision = '3aae2e3789ac'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('enterprise', 'capital',
existing_type=mysql.VARCHAR(length=255),
comment='注册资本,22万美元',
existing_comment='注册资本',
existing_nullable=True)
op.alter_column('enterprise', 'capital_id',
existing_type=mysql.INTEGER(display_width=11),
comment='注册资本大小类型,0-100,1,100-500,2,500-1000,3,1000-5000,4,5000-10000,5,10000+,6',
existing_comment='注册资本大小类型id,0-100,1,100-500,2,500-1000,3,1000-5000,4,5000-10000,5,10000+,6',
existing_nullable=True)
op.drop_constraint('enterprise_ibfk_1', 'enterprise', type_='foreignkey')
op.drop_column('enterprise', 'industry_chain_id')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('enterprise', sa.Column('industry_chain_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
op.create_foreign_key('enterprise_ibfk_1', 'enterprise', 'industry_chain', ['industry_chain_id'], ['id'])
op.alter_column('enterprise', 'capital_id',
existing_type=mysql.INTEGER(display_width=11),
comment='注册资本大小类型id,0-100,1,100-500,2,500-1000,3,1000-5000,4,5000-10000,5,10000+,6',
existing_comment='注册资本大小类型,0-100,1,100-500,2,500-1000,3,1000-5000,4,5000-10000,5,10000+,6',
existing_nullable=True)
op.alter_column('enterprise', 'capital',
existing_type=mysql.VARCHAR(length=255),
comment='注册资本',
existing_comment='注册资本,22万美元',
existing_nullable=True)
# ### end Alembic commands ###
"""empty message
Revision ID: 1b90a0436228
Revises: 34fd2628b8f0
Create Date: 2023-02-02 15:45:32.961356
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '1b90a0436228'
down_revision = '34fd2628b8f0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('enterprise', 'product_all1')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('enterprise', sa.Column('product_all1', mysql.VARCHAR(length=255), nullable=True, comment='公司拥有产品'))
# ### end Alembic commands ###
"""empty message
Revision ID: 1ba77e435ccc
Revises: 1ff7d07e030c
Create Date: 2022-12-04 14:58:25.890782
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1ba77e435ccc'
down_revision = '1ff7d07e030c'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('user_company',
sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('company_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['company_id'], ['company.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('user_id', 'company_id')
)
op.create_table('user_enterprise',
sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('enterprise_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['enterprise_id'], ['enterprise.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('user_id', 'enterprise_id')
)
op.create_table('user_industry',
sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('industry_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['industry_id'], ['industry.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('user_id', 'industry_id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('user_industry')
op.drop_table('user_enterprise')
op.drop_table('user_company')
# ### end Alembic commands ###
"""empty message
Revision ID: 1c2f6dbb41a4
Revises: 48b5fb3c737c
Create Date: 2023-03-02 14:49:09.561091
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '1c2f6dbb41a4'
down_revision = '48b5fb3c737c'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user_project', sa.Column('project_id', sa.Integer(), nullable=False))
op.drop_constraint('user_project_ibfk_1', 'user_project', type_='foreignkey')
op.create_foreign_key(None, 'user_project', 'project', ['project_id'], ['id'])
op.drop_column('user_project', 'factory_id')
op.add_column('user_zone', sa.Column('zone_id', sa.Integer(), nullable=False))
op.drop_constraint('user_zone_ibfk_1', 'user_zone', type_='foreignkey')
op.create_foreign_key(None, 'user_zone', 'induzone', ['zone_id'], ['id'])
op.drop_column('user_zone', 'factory_id')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user_zone', sa.Column('factory_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False))
op.drop_constraint(None, 'user_zone', type_='foreignkey')
op.create_foreign_key('user_zone_ibfk_1', 'user_zone', 'induzone', ['factory_id'], ['id'])
op.drop_column('user_zone', 'zone_id')
op.add_column('user_project', sa.Column('factory_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False))
op.drop_constraint(None, 'user_project', type_='foreignkey')
op.create_foreign_key('user_project_ibfk_1', 'user_project', 'project', ['factory_id'], ['id'])
op.drop_column('user_project', 'project_id')
# ### end Alembic commands ###
"""empty message
Revision ID: 1e56d07b5625
Revises: 653e364e2467
Create Date: 2023-01-05 15:20:35.945953
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '1e56d07b5625'
down_revision = '653e364e2467'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('industry_chain', 'icon_url',
existing_type=mysql.VARCHAR(length=255),
comment='选中时行业图标',
existing_comment='行业图标',
existing_nullable=True)
op.alter_column('industry_chain', 'icon_url1',
existing_type=mysql.VARCHAR(length=255),
comment='未选中时行业图标',
existing_comment='未选中时行业图标1',
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('industry_chain', 'icon_url1',
existing_type=mysql.VARCHAR(length=255),
comment='未选中时行业图标1',
existing_comment='未选中时行业图标',
existing_nullable=True)
op.alter_column('industry_chain', 'icon_url',
existing_type=mysql.VARCHAR(length=255),
comment='行业图标',
existing_comment='选中时行业图标',
existing_nullable=True)
# ### end Alembic commands ###
"""create table
Revision ID: 1edbd9516fdc
Revises: 0d39b971db58
Create Date: 2021-12-02 16:59:12.072185
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '1edbd9516fdc'
down_revision = '0d39b971db58'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('company', 'sxmon',
existing_type=mysql.VARCHAR(length=32),
comment='是否山西民营100强',
existing_comment='是否山西民营100强(2019年)',
existing_nullable=True)
op.alter_column('company', 'takingn',
existing_type=mysql.FLOAT(),
comment='营收 (万元)',
existing_comment='2019营收 (万元)',
existing_nullable=True)
op.alter_column('company', 'ouputn',
existing_type=mysql.FLOAT(),
comment='年产值',
existing_comment='2019年产值',
existing_nullable=True)
op.alter_column('company', 'profit',
existing_type=mysql.FLOAT(),
comment='公司利润(万元)',
existing_comment='2019公司利润(万元)',
existing_nullable=True)
op.alter_column('industry', 'nid',
existing_type=mysql.INTEGER(display_width=11),
comment='导航id(对应企业数据表中的f_type)',
existing_comment='导航id(导航在企业数据中的id)',
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('industry', 'nid',
existing_type=mysql.INTEGER(display_width=11),
comment='导航id(导航在企业数据中的id)',
existing_comment='导航id(对应企业数据表中的f_type)',
existing_nullable=True)
op.alter_column('company', 'profit',
existing_type=mysql.FLOAT(),
comment='2019公司利润(万元)',
existing_comment='公司利润(万元)',
existing_nullable=True)
op.alter_column('company', 'ouputn',
existing_type=mysql.FLOAT(),
comment='2019年产值',
existing_comment='年产值',
existing_nullable=True)
op.alter_column('company', 'takingn',
existing_type=mysql.FLOAT(),
comment='2019营收 (万元)',
existing_comment='营收 (万元)',
existing_nullable=True)
op.alter_column('company', 'sxmon',
existing_type=mysql.VARCHAR(length=32),
comment='是否山西民营100强(2019年)',
existing_comment='是否山西民营100强',
existing_nullable=True)
# ### end Alembic commands ###
"""empty message
Revision ID: 1ff7d07e030c
Revises: 25886ec607fa
Create Date: 2022-12-04 14:32:16.229721
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1ff7d07e030c'
down_revision = '25886ec607fa'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('industry_collect', sa.Column('industry_id', sa.Integer(), nullable=True, comment='产业id'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('industry_collect', 'industry_id')
# ### end Alembic commands ###
"""empty message
Revision ID: 21bedb912ce7
Revises: f0d08e2d1ce5
Create Date: 2022-11-21 16:57:53.310452
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '21bedb912ce7'
down_revision = 'f0d08e2d1ce5'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('project_management',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('project_stalker', sa.String(length=30), nullable=True, comment='项目跟踪'),
sa.Column('project_name', sa.String(length=30), nullable=True, comment='项目名称'),
sa.Column('district', sa.String(length=20), nullable=True, comment='项目所在地'),
sa.Column('development_area', sa.String(length=20), nullable=True, comment='开发区'),
sa.Column('attract_name', sa.String(length=30), nullable=True, comment='引资方名称'),
sa.Column('investor_name', sa.String(length=30), nullable=True, comment='投资方名称'),
sa.Column('investor_district', sa.String(length=30), nullable=True, comment='投资方所在地'),
sa.Column('industry', sa.String(length=20), nullable=True, comment='所属行业'),
sa.Column('investment_volume', sa.Float(), nullable=True, comment='总投资额(万元)'),
sa.Column('construction_content', sa.String(length=30), nullable=True, comment='建设内容'),
sa.Column('project_address', sa.String(length=20), nullable=True, comment='项目选址'),
sa.Column('project_progress', sa.String(length=30), nullable=True, comment='项目进展'),
sa.Column('project_problem', sa.String(length=255), nullable=True, comment='难点情况'),
sa.Column('project_year', sa.Integer(), nullable=True, comment='项目年份'),
sa.Column('upload_unity', sa.String(length=20), nullable=True, comment='上传部门'),
sa.Column('upload_people', sa.String(length=20), nullable=True, comment='上传人'),
sa.Column('upload_time', sa.DateTime(), nullable=True, comment='上传时间'),
sa.Column('project_num', sa.String(length=30), nullable=True, comment='项目编号'),
sa.Column('project_source', sa.String(length=20), nullable=True, comment='项目来源'),
sa.Column('project_unity', sa.String(length=20), nullable=True, comment='项目申报单位'),
sa.Column('is_development_project', sa.String(length=20), nullable=True, comment='是否属于开发区项目'),
sa.Column('sign_time', sa.DateTime(), nullable=True, comment='签约时间'),
sa.Column('start_time', sa.DateTime(), nullable=True, comment='开工时间'),
sa.Column('end_time', sa.DateTime(), nullable=True, comment='竣工时间'),
sa.Column('investor_rank', sa.String(length=30), nullable=True, comment='投资方排名'),
sa.Column('is_transf_project', sa.String(length=30), nullable=True, comment='是否转型项目'),
sa.Column('country', sa.String(length=30), nullable=True, comment='投资方国别'),
sa.Column('provence', sa.String(length=30), nullable=True, comment='投资方省份'),
sa.Column('city', sa.String(length=30), nullable=True, comment='投资方市'),
sa.Column('job_num', sa.Integer(), nullable=True, comment='带动就业岗位(个)'),
sa.Column('new_value', sa.Float(), nullable=True, comment='新增产值(亿元)'),
sa.Column('revenue', sa.Float(), nullable=True, comment='贡献税收(亿元)'),
sa.Column('use_land', sa.String(length=30), nullable=True, comment='项目用地情况(亩)'),
sa.Column('new_land', sa.String(length=30), nullable=True, comment='其中新增用地(亩)'),
sa.Column('construction_nature', sa.String(length=30), nullable=True, comment='建设性质(亩)'),
sa.Column('is_fixed_investment', sa.String(length=30), nullable=True, comment='固定资产投资项目'),
sa.Column('investment_year', sa.String(length=20), nullable=True, comment='资金到位本年累计(万元)'),
sa.Column('investment_history', sa.String(length=20), nullable=True, comment='资金到位历史累计(万元)'),
sa.Column('cooperation_way', sa.String(length=20), nullable=True, comment='合作方式'),
sa.Column('set_project_status', sa.String(length=20), nullable=True, comment='项目立项状态'),
sa.Column('investor_people', sa.String(length=30), nullable=True, comment='投资方联系人'),
sa.Column('investor_mobile', sa.String(length=30), nullable=True, comment='投资方电话'),
sa.Column('investor_address', sa.String(length=30), nullable=True, comment='投资方联系地址'),
sa.PrimaryKeyConstraint('id'),
comment='项目化管理-项目信息表'
)
op.alter_column('siku_project', 'sign_explain',
existing_type=mysql.VARCHAR(length=255),
comment='签约方式说明',
existing_comment='其他签约说明',
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('siku_project', 'sign_explain',
existing_type=mysql.VARCHAR(length=255),
comment='其他签约说明',
existing_comment='签约方式说明',
existing_nullable=True)
op.drop_table('project_management')
# ### end Alembic commands ###
"""create table
Revision ID: 228d82192bf7
Revises:
Create Date: 2021-12-02 15:01:19.570598
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '228d82192bf7'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('enterprise',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='企业主键主键'),
sa.Column('company_name', sa.String(length=255), nullable=True, comment='企业名'),
sa.Column('status', sa.String(length=32), nullable=True, comment='经营状态'),
sa.Column('legal', sa.String(length=255), nullable=True, comment='发定代表人'),
sa.Column('capital', sa.String(length=255), nullable=True, comment='注册资本,22万美元'),
sa.Column('capital_nums', sa.Float(), nullable=True, comment='注册资本转换成人民币数值'),
sa.Column('capital_id', sa.Integer(), nullable=True, comment='注册资本大小类型,0-100,1,100-500,2,500-1000,3,1000-5000,4,5000-10000,5,10000+,6'),
sa.Column('build_date', sa.DateTime(), nullable=True, comment='注册时间'),
sa.Column('yearid', sa.Integer(), nullable=True, comment='成立时间年限id(1-3,1)(3-5,2)(5-8,3)(8-10,4)(10-15,5)(15以上,6)'),
sa.Column('province', sa.String(length=32), nullable=True, comment='省'),
sa.Column('city', sa.String(length=32), nullable=True, comment='市'),
sa.Column('district', sa.String(length=32), nullable=True, comment='区'),
sa.Column('lng', sa.String(length=100), nullable=True, comment='经度'),
sa.Column('lat', sa.String(length=100), nullable=True, comment='纬度'),
sa.Column('p_lng', sa.String(length=100), nullable=True, comment='省经度'),
sa.Column('p_lat', sa.String(length=100), nullable=True, comment='省纬度'),
sa.Column('c_lng', sa.String(length=100), nullable=True, comment='市经度'),
sa.Column('c_lat', sa.String(length=100), nullable=True, comment='市纬度'),
sa.Column('d_lng', sa.String(length=100), nullable=True, comment='区经度'),
sa.Column('d_lat', sa.String(length=100), nullable=True, comment='区纬度'),
sa.Column('address', sa.String(length=255), nullable=True, comment='企业地址'),
sa.Column('telephone', sa.Text(), nullable=True, comment='电话'),
sa.Column('telephone_more', sa.Text(), nullable=True, comment='更多电话'),
sa.Column('email', sa.Text(), nullable=True, comment='邮箱'),
sa.Column('social_code', sa.String(length=100), nullable=True, comment='统一社会信用代码'),
sa.Column('tax_code', sa.String(length=100), nullable=True, comment='纳税人识别号'),
sa.Column('register_code', sa.String(length=100), nullable=True, comment='注册号'),
sa.Column('company_code', sa.String(length=100), nullable=True, comment='组织机构代码'),
sa.Column('bao_num', sa.Integer(), nullable=True, comment='参保人数'),
sa.Column('entype', sa.String(length=100), nullable=True, comment='企业类型'),
sa.Column('entypeid', sa.Integer(), nullable=True, comment='公司类型id(个人独资企业-1)(股份有限公司-2)(有限责任公司-3)(合伙企业-4)(集体所有制-5)(全民所有制企业-6)(外商企业-7)'),
sa.Column('company_industry', sa.String(length=100), nullable=True, comment='所属行业'),
sa.Column('web_site', sa.String(length=255), nullable=True, comment='企业网址'),
sa.Column('business_scope', sa.Text(), nullable=True, comment='企业经营范围'),
sa.Column('money_type', sa.String(length=100), nullable=True, comment='注册币种'),
sa.Column('money_type_id', sa.Integer(), nullable=True, comment='注册币种类型id'),
sa.Column('high_new', sa.String(length=32), nullable=True, comment='是否高新技术企业'),
sa.Column('parti_year', sa.Integer(), nullable=True, comment='高新企业注册年份'),
sa.Column('tbe', sa.String(length=32), nullable=True, comment='是否科技型中小企业'),
sa.Column('fianacing', sa.String(length=32), nullable=True, comment='是否为有融资企业'),
sa.Column('fianacing_rounds', sa.String(length=32), nullable=True, comment='融资轮次'),
sa.Column('roundid', sa.Integer(), nullable=True, comment='融资轮次id(天使/种子,1)(PreA/A+,2)(PreB/B+,3)(C轮以上,4)(收并购,5)(战略投资,6)(其他,7)'),
sa.Column('financing_amount', sa.Float(), nullable=True, comment='融资金额'),
sa.Column('software_copyright', sa.String(length=32), nullable=True, comment='是否为有软件著作权'),
sa.Column('num_software', sa.Integer(), nullable=True, comment='软件著作权个数'),
sa.Column('quoted_company', sa.String(length=32), nullable=True, comment='是否上市企业'),
sa.Column('public_sector', sa.String(length=32), nullable=True, comment='上市板块'),
sa.Column('public_id', sa.Integer(), nullable=True, comment='上市版块的id----360企业画像(A股,1)(创业股,2)(港股,3)(新三股,4)(新四股,5)(中小板,6)'),
sa.Column('foreign_investment', sa.String(length=32), nullable=True, comment='是否外商投资'),
sa.Column('patent', sa.String(length=32), nullable=True, comment='是否为有专利企业'),
sa.Column('num_patent', sa.Integer(), nullable=True, comment='专利个数'),
sa.Column('company_info', sa.Text(), nullable=True, comment='公司简介'),
sa.Column('dengl', sa.String(length=32), nullable=True, comment='瞪羚'),
sa.Column('unicorn', sa.String(length=32), nullable=True, comment='独角兽企业'),
sa.Column('isfive', sa.String(length=32), nullable=True, comment='是否中国500强'),
sa.Column('product_all', sa.String(length=255), nullable=True, comment='公司拥有产品'),
sa.Column('takingn', sa.Float(), nullable=True, comment='营收'),
sa.Column('hots', sa.Integer(), nullable=True, comment='企业热度(权重值)'),
sa.Column('c_name', sa.String(length=255), nullable=True, comment='行业类名'),
sa.Column('c_type', sa.Integer(), nullable=True, comment='行业类id'),
sa.Column('f_name', sa.String(length=255), nullable=True, comment='父行业类名'),
sa.Column('f_type', sa.Integer(), nullable=True, comment='父行业类id'),
sa.PrimaryKeyConstraint('id'),
comment='压测资源表'
)
op.create_index(op.f('ix_enterprise_c_type'), 'enterprise', ['c_type'], unique=False)
op.create_index(op.f('ix_enterprise_city'), 'enterprise', ['city'], unique=False)
op.create_index(op.f('ix_enterprise_company_name'), 'enterprise', ['company_name'], unique=False)
op.create_index(op.f('ix_enterprise_district'), 'enterprise', ['district'], unique=False)
op.create_index(op.f('ix_enterprise_entypeid'), 'enterprise', ['entypeid'], unique=False)
op.create_index(op.f('ix_enterprise_f_type'), 'enterprise', ['f_type'], unique=False)
op.create_index(op.f('ix_enterprise_province'), 'enterprise', ['province'], unique=False)
op.create_index(op.f('ix_enterprise_public_id'), 'enterprise', ['public_id'], unique=False)
op.create_index(op.f('ix_enterprise_roundid'), 'enterprise', ['roundid'], unique=False)
op.create_index(op.f('ix_enterprise_yearid'), 'enterprise', ['yearid'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_enterprise_yearid'), table_name='enterprise')
op.drop_index(op.f('ix_enterprise_roundid'), table_name='enterprise')
op.drop_index(op.f('ix_enterprise_public_id'), table_name='enterprise')
op.drop_index(op.f('ix_enterprise_province'), table_name='enterprise')
op.drop_index(op.f('ix_enterprise_f_type'), table_name='enterprise')
op.drop_index(op.f('ix_enterprise_entypeid'), table_name='enterprise')
op.drop_index(op.f('ix_enterprise_district'), table_name='enterprise')
op.drop_index(op.f('ix_enterprise_company_name'), table_name='enterprise')
op.drop_index(op.f('ix_enterprise_city'), table_name='enterprise')
op.drop_index(op.f('ix_enterprise_c_type'), table_name='enterprise')
op.drop_table('enterprise')
# ### end Alembic commands ###
"""empty message
Revision ID: 25886ec607fa
Revises: 2647b82aeb26
Create Date: 2022-12-03 17:11:46.707769
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '25886ec607fa'
down_revision = '2647b82aeb26'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('industry_collect',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('user_id', sa.Integer(), nullable=True, comment='用户id'),
sa.Column('collect_time', sa.String(length=30), nullable=True, comment='收藏时间'),
sa.Column('industry_name', sa.String(length=30), nullable=True, comment='收藏的产业名称'),
sa.PrimaryKeyConstraint('id'),
comment='招商图谱-产业链收藏'
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('industry_collect')
# ### end Alembic commands ###
"""empty message
Revision ID: 2647b82aeb26
Revises: 657fa1fd4950
Create Date: 2022-12-03 11:40:21.392018
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2647b82aeb26'
down_revision = '657fa1fd4950'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('bstage',
sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('name', sa.String(length=32), nullable=True),
sa.Column('password_hash', sa.String(length=128), nullable=True),
sa.Column('role', sa.Integer(), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('bstage')
# ### end Alembic commands ###
"""empty message
Revision ID: 281173c29995
Revises: 4c7e28f5420d
Create Date: 2022-03-03 16:25:09.445986
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '281173c29995'
down_revision = '4c7e28f5420d'
branch_labels = None
depends_on = None
def upgrade():
pass
def downgrade():
pass
"""empty message
Revision ID: 2a39eca3d412
Revises: 21bedb912ce7
Create Date: 2022-11-21 18:11:57.240984
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2a39eca3d412'
down_revision = '21bedb912ce7'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('project_management', sa.Column('project_stalker_explain', sa.String(length=30), nullable=True, comment='项目跟踪说明'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('project_management', 'project_stalker_explain')
# ### end Alembic commands ###
"""empty message
Revision ID: 2cae5e3d9bd3
Revises: aee7c7c614f7
Create Date: 2023-02-26 10:21:38.459788
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '2cae5e3d9bd3'
down_revision = 'aee7c7c614f7'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index('ix_enterprise_company_id', table_name='enterprise')
op.drop_column('enterprise', 'company_id')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('enterprise', sa.Column('company_id', mysql.INTEGER(display_width=255), autoincrement=False, nullable=True, comment='企业id'))
op.create_index('ix_enterprise_company_id', 'enterprise', ['company_id'], unique=False)
# ### end Alembic commands ###
"""empty message
Revision ID: 2ff5b7509dc4
Revises: 99e2ef03b89c
Create Date: 2022-12-27 11:20:31.050847
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2ff5b7509dc4'
down_revision = '99e2ef03b89c'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('government',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('pnums', sa.Integer(), nullable=True),
sa.Column('charge', sa.String(length=255), nullable=True),
sa.Column('charge_phone', sa.String(length=255), nullable=True),
sa.Column('function', sa.Text(), nullable=True),
sa.Column('name', sa.String(length=255), nullable=False),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_government_name'), 'government', ['name'], unique=False)
op.create_table('followers',
sa.Column('follower_id', sa.Integer(), nullable=False),
sa.Column('followed_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['followed_id'], ['government.id'], ),
sa.ForeignKeyConstraint(['follower_id'], ['government.id'], ),
sa.PrimaryKeyConstraint('follower_id', 'followed_id')
)
op.create_table('section',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('pnums', sa.Integer(), nullable=True),
sa.Column('charge', sa.String(length=255), nullable=True),
sa.Column('charge_phone', sa.String(length=255), nullable=True),
sa.Column('function', sa.Text(), nullable=True),
sa.Column('name', sa.String(length=255), nullable=False),
sa.Column('goverment_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['goverment_id'], ['government.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('group',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('pnums', sa.Integer(), nullable=True),
sa.Column('charge', sa.String(length=255), nullable=True),
sa.Column('charge_phone', sa.String(length=255), nullable=True),
sa.Column('function', sa.Text(), nullable=True),
sa.Column('name', sa.String(length=255), nullable=False),
sa.Column('section_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['section_id'], ['section.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('group')
op.drop_table('section')
op.drop_table('followers')
op.drop_index(op.f('ix_government_name'), table_name='government')
op.drop_table('government')
# ### end Alembic commands ###
"""empty message
Revision ID: 3179f93f4bad
Revises: 63cc590aac22
Create Date: 2022-11-24 10:20:55.779959
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3179f93f4bad'
down_revision = '63cc590aac22'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('project_file', sa.Column('project_id1', sa.Integer(), nullable=True, comment='外键id,项目id'))
op.create_foreign_key(None, 'project_file', 'project_management', ['project_id1'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'project_file', type_='foreignkey')
op.drop_column('project_file', 'project_id1')
# ### end Alembic commands ###
"""empty message
Revision ID: 34fd2628b8f0
Revises: c652571798e5
Create Date: 2023-02-02 11:33:25.066591
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '34fd2628b8f0'
down_revision = 'c652571798e5'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('enterprise', sa.Column('product_all1', sa.String(length=255), nullable=True, comment='公司拥有产品'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('enterprise', 'product_all1')
# ### end Alembic commands ###
"""empty message
Revision ID: 359190e47912
Revises: 8ba3c2cfae73
Create Date: 2023-02-15 19:27:35.784256
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '359190e47912'
down_revision = '8ba3c2cfae73'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('district_resource',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='园区主键id'),
sa.Column('district', sa.String(length=255), nullable=True, comment='园区名称'),
sa.Column('domestic_water', sa.Float(), nullable=True, comment='居民生活用水(元 / 立方米)'),
sa.Column('not_Domestic_water', sa.Float(), nullable=True, comment='非居民用水(元 / 立方米)'),
sa.Column('special_water', sa.Float(), nullable=True, comment='特种用水(元 / 立方米)'),
sa.Column('electricity_life', sa.Float(), nullable=True, comment='居民生活电价'),
sa.Column('electricity_commercial', sa.Float(), nullable=True, comment='商业电价'),
sa.Column('electricity_industrial', sa.Float(), nullable=True, comment='工业电价'),
sa.Column('gas_city', sa.Float(), nullable=True, comment='城市居民用气(元 / 立方米)'),
sa.Column('gas_commercial', sa.Float(), nullable=True, comment='工商业用气(元 / 立方米)'),
sa.Column('hot_life', sa.Float(), nullable=True, comment='居民用热(元 / 平方米)'),
sa.Column('not_hot_life', sa.Float(), nullable=True, comment='非居民用热(元 / 平方米)'),
sa.PrimaryKeyConstraint('id'),
comment='产业现状图谱-产业载体园区信息表'
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('district_resource')
# ### end Alembic commands ###
"""empty message
Revision ID: 3913b03bf96a
Revises: 2cae5e3d9bd3
Create Date: 2023-02-26 10:23:17.432050
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3913b03bf96a'
down_revision = '2cae5e3d9bd3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('enterprise', sa.Column('company_id', sa.String(length=255), nullable=True, comment='企业id'))
op.create_index(op.f('ix_enterprise_company_id'), 'enterprise', ['company_id'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_enterprise_company_id'), table_name='enterprise')
op.drop_column('enterprise', 'company_id')
# ### end Alembic commands ###
"""empty message
Revision ID: 3aae2e3789ac
Revises: 8805cd14ed4c
Create Date: 2023-02-02 17:36:14.981474
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3aae2e3789ac'
down_revision = '8805cd14ed4c'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('enterprise', sa.Column('industry_chain_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'enterprise', 'industry_chain', ['industry_chain_id'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'enterprise', type_='foreignkey')
op.drop_column('enterprise', 'industry_chain_id')
# ### end Alembic commands ###
"""empty message
Revision ID: 3b60b8db0e63
Revises: a2a846da1ccd
Create Date: 2023-02-26 11:16:29.638256
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3b60b8db0e63'
down_revision = 'a2a846da1ccd'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('customer_consultation', sa.Column('is_sync', sa.Integer(), nullable=True, comment='是否同步到平台 0否1是'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('customer_consultation', 'is_sync')
# ### end Alembic commands ###
"""empty message
Revision ID: 408eefbb94e1
Revises: dae54e2910be
Create Date: 2023-03-07 11:54:53.115716
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '408eefbb94e1'
down_revision = 'dae54e2910be'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('enterprise', sa.Column('chain_master', sa.String(length=20), nullable=True, comment='链主企业'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('enterprise', 'chain_master')
# ### end Alembic commands ###
"""empty message
Revision ID: 41f4a2368801
Revises: 0440b17fefaa
Create Date: 2022-11-09 16:41:41.057707
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '41f4a2368801'
down_revision = '0440b17fefaa'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('siku_project',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('distribute_condition', sa.String(length=20), nullable=True, comment='分发情况'),
sa.Column('project_name', sa.String(length=200), nullable=True, comment='项目名称'),
sa.Column('investor_name', sa.String(length=30), nullable=True, comment='投资方名称'),
sa.Column('investor_district', sa.String(length=30), nullable=True, comment='投资方所在地'),
sa.Column('project_type', sa.String(length=30), nullable=True, comment='项目类型'),
sa.Column('investment_volume', sa.Float(), nullable=True, comment='总投资额(万元)'),
sa.Column('project_year', sa.String(length=30), nullable=True, comment='项目年份'),
sa.Column('project_info', sa.String(length=300), nullable=True, comment='项目基本情况'),
sa.Column('thread_people', sa.String(length=30), nullable=True, comment='线索提供人'),
sa.Column('thread_people_unity', sa.String(length=30), nullable=True, comment='线索提供人单位或职务'),
sa.Column('thread_people_mobile', sa.String(length=30), nullable=True, comment='线索提供人联系方式'),
sa.Column('thread_progress', sa.String(length=30), nullable=True, comment='线索进展'),
sa.Column('upload_unity', sa.String(length=20), nullable=True, comment='上传部门'),
sa.Column('upload_people', sa.String(length=20), nullable=True, comment='上传人'),
sa.Column('upload_time', sa.String(length=30), nullable=True, comment='上传时间'),
sa.Column('project_num', sa.String(length=30), nullable=True, comment='项目编号'),
sa.Column('investment_volume1', sa.Float(), nullable=True, comment='拟引资额(万元)'),
sa.Column('project_info1', sa.String(length=300), nullable=True, comment='项目方基本情况'),
sa.Column('project_schedule', sa.String(length=20), nullable=True, comment='项目进展'),
sa.Column('stop_reason', sa.String(length=20), nullable=True, comment='暂停或终止原因'),
sa.Column('thread_source', sa.String(length=20), nullable=True, comment='线索来源'),
sa.Column('cooperation_way', sa.String(length=20), nullable=True, comment='合作方式'),
sa.Column('other_source', sa.String(length=200), nullable=True, comment='其他来源说明'),
sa.Column('remark', sa.String(length=200), nullable=True, comment='备注'),
sa.PrimaryKeyConstraint('id'),
comment='四库管理-项目信息表'
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('siku_project')
# ### end Alembic commands ###
"""empty message
Revision ID: 4257b2a8190f
Revises: 92105a57ac34
Create Date: 2023-09-25 11:16:08.593938
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4257b2a8190f'
down_revision = '92105a57ac34'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('industry_chain1',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('industry_name', sa.String(length=20), nullable=True, comment='行业名称'),
sa.Column('icon_url', sa.String(length=255), nullable=True, comment='未选中时行业图标'),
sa.Column('icon_url1', sa.String(length=255), nullable=True, comment='选中时行业图标'),
sa.Column('status', sa.Integer(), nullable=True, comment='启用状态1启用,2禁用'),
sa.Column('industry_type', sa.Integer(), nullable=True, comment='行业类型(0是产业集群,1是上游行业,2是中游行业,3是下游行业)'),
sa.Column('relate_id', sa.Integer(), nullable=True, comment='关系id(关联哪个产业环节'),
sa.Column('chain_id', sa.Integer(), nullable=True, comment='关系id(关联哪个产业链'),
sa.Column('enterprise_num', sa.Integer(), nullable=True, comment='相关全企业表数量'),
sa.PrimaryKeyConstraint('id'),
comment='新版产业链数据数据表'
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('industry_chain1')
# ### end Alembic commands ###
"""empty message
Revision ID: 480d44ac277f
Revises: 2ff5b7509dc4
Create Date: 2022-12-29 10:30:19.137844
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '480d44ac277f'
down_revision = '2ff5b7509dc4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('industrydistribute',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('industry_name', sa.String(length=20), nullable=True, comment='行业名称'),
sa.Column('industry_num', sa.Integer(), nullable=True, comment='个数'),
sa.Column('investment_volume', sa.Float(), nullable=True, comment='投资额(亿元)'),
sa.PrimaryKeyConstraint('id'),
comment='招商驾驶舱开工项目产业分布数据'
)
op.alter_column('money_arrive', 'arrive_money',
existing_type=mysql.FLOAT(),
comment='固定资产投资项目资金到位额',
existing_comment='固定资产投资项目资金到位额(',
existing_nullable=True)
op.alter_column('user', 'role_id',
existing_type=mysql.INTEGER(display_width=11),
comment='角色id ',
existing_comment='角色id',
existing_nullable=True)
op.alter_column('user', 'status',
existing_type=mysql.INTEGER(display_width=11),
comment='0禁止,1通过,2再审,3驳回',
existing_comment='0禁止,1在用',
existing_nullable=True)
op.alter_column('user', 'position',
existing_type=mysql.VARCHAR(length=128),
comment='职务',
existing_comment='现任职务(职务)',
existing_nullable=True)
op.alter_column('user', 'belong_organization',
existing_type=mysql.VARCHAR(length=30),
comment='单位',
existing_comment='现任工作机构、单位(政府机构,局)',
existing_nullable=True)
op.alter_column('user', 'belong_department',
existing_type=mysql.VARCHAR(length=30),
comment='部门',
existing_comment='所在部门(部门)',
existing_nullable=True)
op.drop_constraint('user_ibfk_1', 'user', type_='foreignkey')
op.drop_column('user', 'level')
op.drop_column('user', 'charge_organization')
op.drop_column('user', 'email')
op.drop_column('user', 'is_department_manager')
op.drop_column('user', 'is_organization_manager')
op.drop_column('user', 'age')
op.drop_column('user', 'function')
op.drop_column('user', 'sex')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user', sa.Column('sex', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='性别,男1女2'))
op.add_column('user', sa.Column('function', mysql.TEXT(), nullable=True, comment='工作职能 ---个人中心'))
op.add_column('user', sa.Column('age', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='年龄'))
op.add_column('user', sa.Column('is_organization_manager', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='是否是机构负责人'))
op.add_column('user', sa.Column('is_department_manager', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='是否是部门负责人'))
op.add_column('user', sa.Column('email', mysql.VARCHAR(length=20), nullable=True, comment='邮箱'))
op.add_column('user', sa.Column('charge_organization', mysql.VARCHAR(length=30), nullable=True, comment='是机构负责人的话,所负责的机构'))
op.add_column('user', sa.Column('level', mysql.VARCHAR(length=128), nullable=True, comment='职级(职级) 跟role_id对应'))
op.create_foreign_key('user_ibfk_1', 'user', 'role', ['role_id'], ['id'])
op.alter_column('user', 'belong_department',
existing_type=mysql.VARCHAR(length=30),
comment='所在部门(部门)',
existing_comment='部门',
existing_nullable=True)
op.alter_column('user', 'belong_organization',
existing_type=mysql.VARCHAR(length=30),
comment='现任工作机构、单位(政府机构,局)',
existing_comment='单位',
existing_nullable=True)
op.alter_column('user', 'position',
existing_type=mysql.VARCHAR(length=128),
comment='现任职务(职务)',
existing_comment='职务',
existing_nullable=True)
op.alter_column('user', 'status',
existing_type=mysql.INTEGER(display_width=11),
comment='0禁止,1在用',
existing_comment='0禁止,1通过,2再审,3驳回',
existing_nullable=True)
op.alter_column('user', 'role_id',
existing_type=mysql.INTEGER(display_width=11),
comment='角色id',
existing_comment='角色id ',
existing_nullable=True)
op.alter_column('money_arrive', 'arrive_money',
existing_type=mysql.FLOAT(),
comment='固定资产投资项目资金到位额(',
existing_comment='固定资产投资项目资金到位额',
existing_nullable=True)
op.drop_table('industrydistribute')
# ### end Alembic commands ###
"""empty message
Revision ID: 4875ed38bd46
Revises: 12cd8a15569b
Create Date: 2023-03-09 18:24:10.892486
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4875ed38bd46'
down_revision = '12cd8a15569b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('company', sa.Column('company_id', sa.String(length=255), nullable=True, comment='企业id'))
op.create_index(op.f('ix_company_company_id'), 'company', ['company_id'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_company_company_id'), table_name='company')
op.drop_column('company', 'company_id')
# ### end Alembic commands ###
"""empty message
Revision ID: 48b5fb3c737c
Revises: 3b60b8db0e63
Create Date: 2023-03-01 10:45:18.627649
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '48b5fb3c737c'
down_revision = '3b60b8db0e63'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('carrier_build', sa.Column('other_attract_status', sa.String(length=20), nullable=True, comment='其他产业名称'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('carrier_build', 'other_attract_status')
# ### end Alembic commands ###
"""empty message
Revision ID: 49d31ab855b4
Revises: 359190e47912
Create Date: 2023-02-16 11:02:20.797560
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '49d31ab855b4'
down_revision = '359190e47912'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('labor_cost',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='园区主键id'),
sa.Column('district', sa.String(length=255), nullable=True, comment='区县名称'),
sa.Column('endowment_insurance1', sa.Float(), nullable=True, comment='公司缴xx %'),
sa.Column('endowment_insurance2', sa.Float(), nullable=True, comment='个人缴xx %'),
sa.Column('unemployment_insurance1', sa.Float(), nullable=True, comment='公司缴XX %'),
sa.Column('unemployment_insurance2', sa.Float(), nullable=True, comment='个人缴X %'),
sa.Column('injury_insurance1', sa.Float(), nullable=True, comment='公司缴XX %'),
sa.Column('injury_insurance2', sa.Float(), nullable=True, comment='个人缴X %'),
sa.Column('maternity_insurance1', sa.Float(), nullable=True, comment='公司缴XX %'),
sa.Column('maternity_insurance2', sa.Float(), nullable=True, comment='个人缴X %'),
sa.Column('medical_insurance1', sa.Float(), nullable=True, comment='公司缴XX %'),
sa.Column('medical_insurance2', sa.Float(), nullable=True, comment='个人缴X %'),
sa.Column('wage_rates', sa.Float(), nullable=True, comment='工资标准(人社局)'),
sa.Column('month_wage_rates', sa.Float(), nullable=True, comment='月最低工资工资标准'),
sa.Column('hour_wage_rates', sa.Float(), nullable=True, comment='非全日制用工小时最低工资标准'),
sa.PrimaryKeyConstraint('id'),
comment='现状图谱-投资成本-劳动力成本'
)
op.alter_column('district_resource', 'district',
existing_type=mysql.VARCHAR(length=255),
comment='区县名称',
existing_comment='园区名称',
existing_nullable=True)
op.create_table_comment(
'district_resource',
'现状图谱-投资成本-水电气暖价格',
existing_comment='产业现状图谱-产业载体园区信息表',
schema=None
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table_comment(
'district_resource',
'产业现状图谱-产业载体园区信息表',
existing_comment='现状图谱-投资成本-水电气暖价格',
schema=None
)
op.alter_column('district_resource', 'district',
existing_type=mysql.VARCHAR(length=255),
comment='园区名称',
existing_comment='区县名称',
existing_nullable=True)
op.drop_table('labor_cost')
# ### end Alembic commands ###
"""create table
Revision ID: 4c7e28f5420d
Revises: 842339173242
Create Date: 2021-12-07 16:05:58.521175
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4c7e28f5420d'
down_revision = '842339173242'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table_comment(
'induzone',
'产业现状图谱-产业载体园区信息表',
existing_comment='晋城园区信息表',
schema=None
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table_comment(
'induzone',
'晋城园区信息表',
existing_comment='产业现状图谱-产业载体园区信息表',
schema=None
)
# ### end Alembic commands ###
"""empty message
Revision ID: 4ee42e22970a
Revises: 49d31ab855b4
Create Date: 2023-02-16 11:19:13.956847
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '4ee42e22970a'
down_revision = '49d31ab855b4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('labor_cost', 'endowment_insurance1',
existing_type=mysql.FLOAT(),
comment='养老保险公司缴xx %',
existing_comment='公司缴xx %',
existing_nullable=True)
op.alter_column('labor_cost', 'endowment_insurance2',
existing_type=mysql.FLOAT(),
comment='养老保险个人缴xx %',
existing_comment='个人缴xx %',
existing_nullable=True)
op.alter_column('labor_cost', 'unemployment_insurance1',
existing_type=mysql.FLOAT(),
comment='失业保险公司缴XX %',
existing_comment='公司缴XX %',
existing_nullable=True)
op.alter_column('labor_cost', 'unemployment_insurance2',
existing_type=mysql.FLOAT(),
comment='失业保险个人缴X %',
existing_comment='个人缴X %',
existing_nullable=True)
op.alter_column('labor_cost', 'injury_insurance1',
existing_type=mysql.FLOAT(),
comment='工伤保险公司缴XX %',
existing_comment='公司缴XX %',
existing_nullable=True)
op.alter_column('labor_cost', 'injury_insurance2',
existing_type=mysql.FLOAT(),
comment='工伤保险个人缴X %',
existing_comment='个人缴X %',
existing_nullable=True)
op.alter_column('labor_cost', 'maternity_insurance1',
existing_type=mysql.FLOAT(),
comment='生育保险公司缴XX %',
existing_comment='公司缴XX %',
existing_nullable=True)
op.alter_column('labor_cost', 'maternity_insurance2',
existing_type=mysql.FLOAT(),
comment='生育保险个人缴X %',
existing_comment='个人缴X %',
existing_nullable=True)
op.alter_column('labor_cost', 'medical_insurance1',
existing_type=mysql.FLOAT(),
comment='医疗保险公司缴XX %',
existing_comment='公司缴XX %',
existing_nullable=True)
op.alter_column('labor_cost', 'medical_insurance2',
existing_type=mysql.FLOAT(),
comment='医疗保险个人缴X %',
existing_comment='个人缴X %',
existing_nullable=True)
op.drop_column('labor_cost', 'wage_rates')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('labor_cost', sa.Column('wage_rates', mysql.FLOAT(), nullable=True, comment='工资标准(人社局)'))
op.alter_column('labor_cost', 'medical_insurance2',
existing_type=mysql.FLOAT(),
comment='个人缴X %',
existing_comment='医疗保险个人缴X %',
existing_nullable=True)
op.alter_column('labor_cost', 'medical_insurance1',
existing_type=mysql.FLOAT(),
comment='公司缴XX %',
existing_comment='医疗保险公司缴XX %',
existing_nullable=True)
op.alter_column('labor_cost', 'maternity_insurance2',
existing_type=mysql.FLOAT(),
comment='个人缴X %',
existing_comment='生育保险个人缴X %',
existing_nullable=True)
op.alter_column('labor_cost', 'maternity_insurance1',
existing_type=mysql.FLOAT(),
comment='公司缴XX %',
existing_comment='生育保险公司缴XX %',
existing_nullable=True)
op.alter_column('labor_cost', 'injury_insurance2',
existing_type=mysql.FLOAT(),
comment='个人缴X %',
existing_comment='工伤保险个人缴X %',
existing_nullable=True)
op.alter_column('labor_cost', 'injury_insurance1',
existing_type=mysql.FLOAT(),
comment='公司缴XX %',
existing_comment='工伤保险公司缴XX %',
existing_nullable=True)
op.alter_column('labor_cost', 'unemployment_insurance2',
existing_type=mysql.FLOAT(),
comment='个人缴X %',
existing_comment='失业保险个人缴X %',
existing_nullable=True)
op.alter_column('labor_cost', 'unemployment_insurance1',
existing_type=mysql.FLOAT(),
comment='公司缴XX %',
existing_comment='失业保险公司缴XX %',
existing_nullable=True)
op.alter_column('labor_cost', 'endowment_insurance2',
existing_type=mysql.FLOAT(),
comment='个人缴xx %',
existing_comment='养老保险个人缴xx %',
existing_nullable=True)
op.alter_column('labor_cost', 'endowment_insurance1',
existing_type=mysql.FLOAT(),
comment='公司缴xx %',
existing_comment='养老保险公司缴xx %',
existing_nullable=True)
# ### end Alembic commands ###
"""empty message
Revision ID: 4ff348e88f11
Revises: 367cd2f84fd1
Create Date: 2023-02-22 14:14:02.931883
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '4ff348e88f11'
down_revision = '367cd2f84fd1'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('carrier_land', sa.Column('detail_address', sa.String(length=50), nullable=True, comment='土地位置'))
op.drop_column('carrier_land', 'location')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('carrier_land', sa.Column('location', mysql.VARCHAR(length=50), nullable=True, comment='土地位置'))
op.drop_column('carrier_land', 'detail_address')
# ### end Alembic commands ###
"""empty message
Revision ID: 567fa4c5fc84
Revises: 0aad01ae0dda
Create Date: 2022-11-16 21:38:20.017395
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '567fa4c5fc84'
down_revision = '0aad01ae0dda'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('project_file',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('flag', sa.Integer(), nullable=True, comment='2为对接库,3为签约库,4为开工库'),
sa.Column('file_type', sa.Integer(), nullable=True, comment='1文件,2图片'),
sa.Column('file_url', sa.String(length=300), nullable=True, comment='相关印证资料图片url'),
sa.Column('file_name', sa.String(length=20), nullable=True, comment='相关印证资料图片名称'),
sa.Column('project_id', sa.Integer(), nullable=True, comment='外键id,项目id'),
sa.ForeignKeyConstraint(['project_id'], ['siku_project.id'], ),
sa.PrimaryKeyConstraint('id'),
comment='四库管理对接库-相关印证资料图片'
)
op.drop_table('joint_img')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('joint_img',
sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('flag', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='2为对接库,3为签约库,4为开工库'),
sa.Column('img_url', mysql.VARCHAR(length=300), nullable=True, comment='相关印证资料图片url'),
sa.Column('img_name', mysql.VARCHAR(length=20), nullable=True, comment='相关印证资料图片名称'),
sa.Column('project_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='外键id,项目id'),
sa.ForeignKeyConstraint(['project_id'], ['siku_project.id'], name='joint_img_ibfk_1'),
sa.PrimaryKeyConstraint('id'),
comment='四库管理对接库-相关印证资料图片',
mysql_comment='四库管理对接库-相关印证资料图片',
mysql_default_charset='utf8',
mysql_engine='InnoDB'
)
op.drop_table('project_file')
# ### end Alembic commands ###
"""empty message
Revision ID: 577f52798418
Revises: 6de45042c0d0
Create Date: 2023-01-12 15:54:17.153772
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '577f52798418'
down_revision = '6de45042c0d0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('enterprise', sa.Column('sxonhun', sa.String(length=32), nullable=True))
op.add_column('enterprise', sa.Column('scale', sa.String(length=32), nullable=True))
op.add_column('enterprise', sa.Column('serve', sa.String(length=32), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('enterprise', 'serve')
op.drop_column('enterprise', 'scale')
op.drop_column('enterprise', 'sxonhun')
# ### end Alembic commands ###
"""empty message
Revision ID: 5faec18e77e2
Revises: 3179f93f4bad
Create Date: 2022-11-24 10:28:38.209707
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '5faec18e77e2'
down_revision = '3179f93f4bad'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('project_file', sa.Column('project_manager_id', sa.Integer(), nullable=True, comment='外键id,项目id'))
op.drop_constraint('project_file_ibfk_2', 'project_file', type_='foreignkey')
op.create_foreign_key(None, 'project_file', 'project_management', ['project_manager_id'], ['id'])
op.drop_column('project_file', 'project_id1')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('project_file', sa.Column('project_id1', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='外键id,项目id'))
op.drop_constraint(None, 'project_file', type_='foreignkey')
op.create_foreign_key('project_file_ibfk_2', 'project_file', 'project_management', ['project_id1'], ['id'])
op.drop_column('project_file', 'project_manager_id')
# ### end Alembic commands ###
"""empty message
Revision ID: 6214c8d7cb5d
Revises: 9ef30d50f9e0
Create Date: 2023-01-05 14:33:32.126051
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6214c8d7cb5d'
down_revision = '9ef30d50f9e0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('industry_chain', sa.Column('icon_url', sa.String(length=255), nullable=True, comment='行业图标'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('industry_chain', 'icon_url')
# ### end Alembic commands ###
"""empty message
Revision ID: 63cc590aac22
Revises: b9af264d3544
Create Date: 2022-11-24 10:06:47.863898
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '63cc590aac22'
down_revision = 'b9af264d3544'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('shanxi_target', sa.Column('district_name', sa.String(length=30), nullable=True, comment='区县名称'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('shanxi_target', 'district_name')
# ### end Alembic commands ###
"""empty message
Revision ID: 6470d982afcb
Revises: 7b3c7cc35c61
Create Date: 2022-11-24 20:18:35.732056
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6470d982afcb'
down_revision = '7b3c7cc35c61'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('jc_target', sa.Column('file_name', sa.String(length=30), nullable=True, comment='文件名称'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('jc_target', 'file_name')
# ### end Alembic commands ###
"""empty message
Revision ID: 64b32417349b
Revises: 1249c599d875
Create Date: 2023-02-22 00:27:40.254685
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '64b32417349b'
down_revision = '1249c599d875'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('investment_consultation',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('project_name', sa.String(length=20), nullable=True, comment='项目名称'),
sa.Column('investor', sa.Integer(), nullable=True, comment='投资方名称'),
sa.Column('investor_place', sa.String(length=100), nullable=True, comment='投资方所在地'),
sa.Column('project_type', sa.String(length=20), nullable=True, comment='项目类型'),
sa.Column('investment_volume', sa.Text(), nullable=True, comment='总投资额'),
sa.Column('basic_information', sa.Text(), nullable=True, comment='项目方基本情况'),
sa.Column('land_area', sa.Text(), nullable=True, comment='拟落地区域'),
sa.Column('flag', sa.Integer(), nullable=True, comment='是否已回复 0否1是'),
sa.Column('reply_content', sa.Text(), nullable=True, comment='回复内容'),
sa.PrimaryKeyConstraint('id'),
comment='小程序-客户咨询信息表'
)
op.add_column('company', sa.Column('chain_master', sa.String(length=20), nullable=True, comment='链主企业'))
op.create_table_comment(
'introduction_meet',
'小程序-推介会数据表',
existing_comment='推介会数据表',
schema=None
)
op.add_column('investment_information', sa.Column('content', sa.Text(), nullable=True, comment='正文'))
op.create_table_comment(
'investment_information',
'小程序-招商资讯数据表',
existing_comment='招商资讯数据表',
schema=None
)
op.drop_column('investment_information', 'info')
op.add_column('zaiti_build', sa.Column('lng', sa.String(length=50), nullable=True, comment='经度'))
op.add_column('zaiti_build', sa.Column('lat', sa.String(length=50), nullable=True, comment='维度'))
op.add_column('zaiti_factory', sa.Column('lng', sa.String(length=50), nullable=True, comment='经度'))
op.add_column('zaiti_factory', sa.Column('lat', sa.String(length=50), nullable=True, comment='维度'))
op.add_column('zaiti_land', sa.Column('lng', sa.String(length=50), nullable=True, comment='经度'))
op.add_column('zaiti_land', sa.Column('lat', sa.String(length=50), nullable=True, comment='维度'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('zaiti_land', 'lat')
op.drop_column('zaiti_land', 'lng')
op.drop_column('zaiti_factory', 'lat')
op.drop_column('zaiti_factory', 'lng')
op.drop_column('zaiti_build', 'lat')
op.drop_column('zaiti_build', 'lng')
op.add_column('investment_information', sa.Column('info', mysql.TEXT(), nullable=True, comment='介绍'))
op.create_table_comment(
'investment_information',
'招商资讯数据表',
existing_comment='小程序-招商资讯数据表',
schema=None
)
op.drop_column('investment_information', 'content')
op.create_table_comment(
'introduction_meet',
'推介会数据表',
existing_comment='小程序-推介会数据表',
schema=None
)
op.drop_column('company', 'chain_master')
op.drop_table('investment_consultation')
# ### end Alembic commands ###
"""empty message
Revision ID: 653e364e2467
Revises: 6214c8d7cb5d
Create Date: 2023-01-05 15:19:49.029798
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '653e364e2467'
down_revision = '6214c8d7cb5d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('industry_chain', sa.Column('icon_url1', sa.String(length=255), nullable=True, comment='未选中时行业图标1'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('industry_chain', 'icon_url1')
# ### end Alembic commands ###
"""empty message
Revision ID: 6552335d82e5
Revises: c842c3d27d7d
Create Date: 2023-02-22 17:07:23.152064
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '6552335d82e5'
down_revision = 'c842c3d27d7d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('carrier_build', sa.Column('inside_picture_url', sa.String(length=255), nullable=True, comment='内部照片url'))
op.add_column('carrier_build', sa.Column('outer_picture_url', sa.String(length=255), nullable=True, comment='外部照片url'))
op.add_column('carrier_build', sa.Column('price_url', sa.String(length=255), nullable=True, comment='平面图url'))
op.drop_column('carrier_build', 'build_pic')
op.add_column('carrier_land', sa.Column('price_url', sa.String(length=20), nullable=True, comment='用地红线图'))
op.drop_column('carrier_land', 'red_line_map')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('carrier_land', sa.Column('red_line_map', mysql.VARCHAR(length=20), nullable=True, comment='用地红线图'))
op.drop_column('carrier_land', 'price_url')
op.add_column('carrier_build', sa.Column('build_pic', mysql.VARCHAR(length=20), nullable=True, comment='楼宇图片'))
op.drop_column('carrier_build', 'price_url')
op.drop_column('carrier_build', 'outer_picture_url')
op.drop_column('carrier_build', 'inside_picture_url')
# ### end Alembic commands ###
"""empty message
Revision ID: 657fa1fd4950
Revises: 86cebc03f6ec
Create Date: 2022-12-02 10:40:57.784706
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '657fa1fd4950'
down_revision = '86cebc03f6ec'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('siku_project', sa.Column('industry', sa.String(length=20), nullable=True, comment='所属行业-一级产业'))
op.add_column('siku_project', sa.Column('industry2', sa.String(length=20), nullable=True, comment='所属行业-二级产业'))
op.add_column('siku_project', sa.Column('provence', sa.String(length=30), nullable=True, comment='投资方省份'))
op.add_column('siku_project', sa.Column('city', sa.String(length=30), nullable=True, comment='投资方市'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('siku_project', 'city')
op.drop_column('siku_project', 'provence')
op.drop_column('siku_project', 'industry2')
op.drop_column('siku_project', 'industry')
# ### end Alembic commands ###
"""empty message
Revision ID: 6ab647f6d851
Revises: 1148aa49cc24
Create Date: 2023-02-23 16:29:42.838157
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6ab647f6d851'
down_revision = '1148aa49cc24'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('customer_consultation', sa.Column('linkman', sa.String(length=20), nullable=True, comment='联系人'))
op.add_column('customer_consultation', sa.Column('link_mobile', sa.String(length=20), nullable=True, comment='联系方式'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('customer_consultation', 'link_mobile')
op.drop_column('customer_consultation', 'linkman')
# ### end Alembic commands ###
"""empty message
Revision ID: 6af94c9dab96
Revises: 7647adcdc298
Create Date: 2022-11-22 16:13:20.690034
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '6af94c9dab96'
down_revision = '7647adcdc298'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('project_file', 'flag',
existing_type=mysql.INTEGER(display_width=11),
comment='2为对接库,3为签约库,4为开工库,其他5',
existing_comment='2为对接库,3为签约库,4为开工库',
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('project_file', 'flag',
existing_type=mysql.INTEGER(display_width=11),
comment='2为对接库,3为签约库,4为开工库',
existing_comment='2为对接库,3为签约库,4为开工库,其他5',
existing_nullable=True)
# ### end Alembic commands ###
"""empty message
Revision ID: 6de45042c0d0
Revises: d40bf2ca852c
Create Date: 2023-01-10 15:19:14.981291
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '6de45042c0d0'
down_revision = 'd40bf2ca852c'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('industry_chain', 'icon_url',
existing_type=mysql.VARCHAR(length=255),
nullable=True,
existing_comment='未选中时行业图标')
op.alter_column('industry_chain', 'icon_url1',
existing_type=mysql.VARCHAR(length=255),
nullable=True,
existing_comment='选中时行业图标')
op.alter_column('industry_chain', 'status',
existing_type=mysql.INTEGER(display_width=11),
nullable=True,
existing_comment='启用状态1启用,2禁用')
op.alter_column('industry_chain', 'relate_id',
existing_type=mysql.INTEGER(display_width=11),
comment='关系id(关联与哪个产业环节',
existing_comment='关系id(关联于哪个产业环节的id)',
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('industry_chain', 'relate_id',
existing_type=mysql.INTEGER(display_width=11),
comment='关系id(关联于哪个产业环节的id)',
existing_comment='关系id(关联与哪个产业环节',
existing_nullable=True)
op.alter_column('industry_chain', 'status',
existing_type=mysql.INTEGER(display_width=11),
nullable=False,
existing_comment='启用状态1启用,2禁用')
op.alter_column('industry_chain', 'icon_url1',
existing_type=mysql.VARCHAR(length=255),
nullable=False,
existing_comment='选中时行业图标')
op.alter_column('industry_chain', 'icon_url',
existing_type=mysql.VARCHAR(length=255),
nullable=False,
existing_comment='未选中时行业图标')
# ### end Alembic commands ###
"""empty message
Revision ID: 736c3275e5f3
Revises: b585af1123cc
Create Date: 2023-01-04 14:36:59.565644
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '736c3275e5f3'
down_revision = 'b585af1123cc'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user', 'role_id')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user', sa.Column('role_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='角色id '))
# ### end Alembic commands ###
"""empty message
Revision ID: 7647adcdc298
Revises: 2a39eca3d412
Create Date: 2022-11-22 11:55:26.663885
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7647adcdc298'
down_revision = '2a39eca3d412'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('project_management', sa.Column('is_delete', sa.Integer(), nullable=True, comment='逻辑删除'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('project_management', 'is_delete')
# ### end Alembic commands ###
"""empty message
Revision ID: 796079d17881
Revises: 19ac0d1f0f55
Create Date: 2023-02-03 10:23:52.903625
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '796079d17881'
down_revision = '19ac0d1f0f55'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('enterprise', sa.Column('industry_chain_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'enterprise', 'industry_chain', ['industry_chain_id'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'enterprise', type_='foreignkey')
op.drop_column('enterprise', 'industry_chain_id')
# ### end Alembic commands ###
"""empty message
Revision ID: 7b3c7cc35c61
Revises: 10b496f3dd09
Create Date: 2022-11-24 20:17:13.925189
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7b3c7cc35c61'
down_revision = '10b496f3dd09'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('jc_target',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('is_delete', sa.Integer(), nullable=True, comment='逻辑删除'),
sa.Column('year', sa.String(length=30), nullable=True, comment='数据年份'),
sa.Column('upload_time', sa.String(length=30), nullable=True, comment='上传日期'),
sa.Column('upload_unit', sa.String(length=30), nullable=True, comment='上传部门'),
sa.Column('upload_people', sa.String(length=30), nullable=True, comment='上传人'),
sa.Column('grade_sign', sa.Float(), nullable=True, comment='签约项目金额'),
sa.Column('grade_start', sa.Float(), nullable=True, comment='项目开工率'),
sa.Column('grade_plan_invest', sa.Float(), nullable=True, comment='新开工固定资产投资项目计划投资额'),
sa.Column('grade_arrive_target1', sa.Float(), nullable=True, comment='固定资产投资项目资金到位额'),
sa.Column('grade_arrive_target0', sa.Float(), nullable=True, comment='非固定资产投资项目资金到位额'),
sa.Column('district_name', sa.String(length=30), nullable=True, comment='区县名称'),
sa.Column('money_sign', sa.Float(), nullable=True, comment='签约项目金额'),
sa.Column('rate_start', sa.Float(), nullable=True, comment='项目开工率'),
sa.Column('money_plan_invest', sa.Float(), nullable=True, comment='新开工固定资产投资项目计划投资额'),
sa.Column('money_arrive_target1', sa.Float(), nullable=True, comment='固定资产投资项目资金到位额'),
sa.Column('money_arrive_target0', sa.Float(), nullable=True, comment='非固定资产投资项目资金到位额'),
sa.PrimaryKeyConstraint('id'),
comment='项目化管理-晋城市县(市、区)、开发区指标表'
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('jc_target')
# ### end Alembic commands ###
"""empty message
Revision ID: 7c65fe37c77f
Revises: 567fa4c5fc84
Create Date: 2022-11-17 10:40:03.957755
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7c65fe37c77f'
down_revision = '567fa4c5fc84'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('sign_three',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('name', sa.String(length=20), nullable=True, comment='第三方名称'),
sa.Column('people', sa.String(length=20), nullable=True, comment='第三方联系人'),
sa.Column('mobile', sa.String(length=20), nullable=True, comment='第三方联系方式'),
sa.Column('project_id', sa.Integer(), nullable=True, comment='外键id,项目id'),
sa.ForeignKeyConstraint(['project_id'], ['siku_project.id'], ),
sa.PrimaryKeyConstraint('id'),
comment='签约库-签约的第三方'
)
op.add_column('project_file', sa.Column('upload_time', sa.String(length=20), nullable=True, comment='上传时间'))
op.add_column('project_file', sa.Column('upload_people', sa.String(length=20), nullable=True, comment='上传人'))
op.add_column('project_file', sa.Column('upload_people_id', sa.Integer(), nullable=True, comment='上传人id'))
op.add_column('siku_project', sa.Column('sign_style', sa.String(length=20), nullable=True, comment='签约方式'))
op.add_column('siku_project', sa.Column('sign_explain', sa.String(length=255), nullable=True, comment='其他签约说明'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('siku_project', 'sign_explain')
op.drop_column('siku_project', 'sign_style')
op.drop_column('project_file', 'upload_people_id')
op.drop_column('project_file', 'upload_people')
op.drop_column('project_file', 'upload_time')
op.drop_table('sign_three')
# ### end Alembic commands ###
"""empty message
Revision ID: 7e6423c3625b
Revises: 0a26b9ded8ca
Create Date: 2023-02-14 11:53:58.733031
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7e6423c3625b'
down_revision = '0a26b9ded8ca'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('enterprise', sa.Column('c_name1', sa.String(length=255), nullable=True, comment='行业类名'))
op.add_column('enterprise', sa.Column('c_type1', sa.Integer(), nullable=True, comment='行业类id'))
op.add_column('enterprise', sa.Column('product_all1', sa.String(length=255), nullable=True, comment='公司拥有产品'))
op.add_column('enterprise', sa.Column('c_name2', sa.String(length=255), nullable=True, comment='行业类名'))
op.add_column('enterprise', sa.Column('c_type2', sa.Integer(), nullable=True, comment='行业类id'))
op.add_column('enterprise', sa.Column('product_all2', sa.String(length=255), nullable=True, comment='公司拥有产品'))
op.create_index(op.f('ix_enterprise_c_type1'), 'enterprise', ['c_type1'], unique=False)
op.create_index(op.f('ix_enterprise_c_type2'), 'enterprise', ['c_type2'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_enterprise_c_type2'), table_name='enterprise')
op.drop_index(op.f('ix_enterprise_c_type1'), table_name='enterprise')
op.drop_column('enterprise', 'product_all2')
op.drop_column('enterprise', 'c_type2')
op.drop_column('enterprise', 'c_name2')
op.drop_column('enterprise', 'product_all1')
op.drop_column('enterprise', 'c_type1')
op.drop_column('enterprise', 'c_name1')
# ### end Alembic commands ###
"""create table
Revision ID: 842339173242
Revises: f9b8176a53e7
Create Date: 2021-12-07 16:01:15.267248
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '842339173242'
down_revision = 'f9b8176a53e7'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table_comment(
'induzone',
'晋城园区信息表',
existing_comment='晋城园区信息',
schema=None
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table_comment(
'induzone',
'晋城园区信息',
existing_comment='晋城园区信息表',
schema=None
)
# ### end Alembic commands ###
"""empty message
Revision ID: 86c28972faba
Revises: cd765f81acd4
Create Date: 2023-03-10 17:59:38.530974
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '86c28972faba'
down_revision = 'cd765f81acd4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('enterprise_punish', 'id',
existing_type=mysql.INTEGER(display_width=11),
comment='信息主键id',
existing_comment='专利信息主键id',
existing_nullable=False,
autoincrement=True)
op.alter_column('enterprise_punish', 'pub_date',
existing_type=mysql.VARCHAR(length=32),
comment='处罚日期',
existing_comment='公开日期',
existing_nullable=True)
op.alter_column('enterprise_punish', 'punish_no',
existing_type=mysql.VARCHAR(length=32),
comment='决定文书号',
existing_comment='处罚日期',
existing_nullable=True)
op.alter_column('enterprise_punish', 'punish_reason',
existing_type=mysql.VARCHAR(length=32),
comment='处罚事由',
existing_comment='决定文书号',
existing_nullable=True)
op.alter_column('enterprise_punish', 'punish_content',
existing_type=mysql.VARCHAR(length=32),
comment='处罚结果/内容',
existing_comment='处罚事由/违法行为类型',
existing_nullable=True)
op.alter_column('enterprise_punish', 'punish_org',
existing_type=mysql.VARCHAR(length=32),
comment='处罚单位',
existing_comment='处罚结果/内容',
existing_nullable=True)
op.alter_column('enterprise_punish', 'sources',
existing_type=mysql.VARCHAR(length=32),
comment='来源',
existing_comment='处罚单位',
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('enterprise_punish', 'sources',
existing_type=mysql.VARCHAR(length=32),
comment='处罚单位',
existing_comment='来源',
existing_nullable=True)
op.alter_column('enterprise_punish', 'punish_org',
existing_type=mysql.VARCHAR(length=32),
comment='处罚结果/内容',
existing_comment='处罚单位',
existing_nullable=True)
op.alter_column('enterprise_punish', 'punish_content',
existing_type=mysql.VARCHAR(length=32),
comment='处罚事由/违法行为类型',
existing_comment='处罚结果/内容',
existing_nullable=True)
op.alter_column('enterprise_punish', 'punish_reason',
existing_type=mysql.VARCHAR(length=32),
comment='决定文书号',
existing_comment='处罚事由',
existing_nullable=True)
op.alter_column('enterprise_punish', 'punish_no',
existing_type=mysql.VARCHAR(length=32),
comment='处罚日期',
existing_comment='决定文书号',
existing_nullable=True)
op.alter_column('enterprise_punish', 'pub_date',
existing_type=mysql.VARCHAR(length=32),
comment='公开日期',
existing_comment='处罚日期',
existing_nullable=True)
op.alter_column('enterprise_punish', 'id',
existing_type=mysql.INTEGER(display_width=11),
comment='专利信息主键id',
existing_comment='信息主键id',
existing_nullable=False,
autoincrement=True)
# ### end Alembic commands ###
"""empty message
Revision ID: 86cebc03f6ec
Revises: c40a14ba57b8
Create Date: 2022-11-28 10:56:00.165149
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '86cebc03f6ec'
down_revision = 'c40a14ba57b8'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('money_arrive', sa.Column('file_name', sa.String(length=30), nullable=True, comment='文件名称'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('money_arrive', 'file_name')
# ### end Alembic commands ###
"""empty message
Revision ID: 86f617b5d0c7
Revises: 41f4a2368801
Create Date: 2022-11-11 11:51:08.013565
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '86f617b5d0c7'
down_revision = '41f4a2368801'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('siku_project', sa.Column('is_delete', sa.Integer(), nullable=True, comment='逻辑删除 1是0否'))
op.add_column('siku_project', sa.Column('project_to_area', sa.String(length=20), nullable=True, comment='拟落地区域'))
op.add_column('siku_project', sa.Column('development_area', sa.String(length=20), nullable=True, comment='开发区'))
op.add_column('siku_project', sa.Column('project_address', sa.String(length=20), nullable=True, comment='项目详细地址'))
op.add_column('siku_project', sa.Column('joint_condition', sa.String(length=20), nullable=True, comment='项目对接情况'))
op.add_column('siku_project', sa.Column('project_problem', sa.String(length=20), nullable=True, comment='项目当前存在的问题'))
op.add_column('siku_project', sa.Column('project_stalker', sa.String(length=20), nullable=True, comment='项目跟踪人'))
op.add_column('siku_project', sa.Column('joint_person', sa.String(length=20), nullable=True, comment='对接人'))
op.add_column('siku_project', sa.Column('joint_person_unity', sa.String(length=20), nullable=True, comment='对接人单位及职务'))
op.add_column('siku_project', sa.Column('joint_person_mobile', sa.String(length=20), nullable=True, comment='对接人联系方式'))
op.add_column('siku_project', sa.Column('project_people', sa.String(length=30), nullable=True, comment='项目方联系人'))
op.add_column('siku_project', sa.Column('project_people_unity', sa.String(length=30), nullable=True, comment='项目方单位或职务'))
op.add_column('siku_project', sa.Column('project_people_mobile', sa.String(length=30), nullable=True, comment='项目方联系方式'))
op.add_column('siku_project', sa.Column('attract_name', sa.String(length=30), nullable=True, comment='引资方名称'))
op.add_column('siku_project', sa.Column('progress_condition', sa.String(length=20), nullable=True, comment='项目推进情况'))
op.add_column('siku_project', sa.Column('Party_A_name', sa.String(length=20), nullable=True, comment='签约甲方名称'))
op.add_column('siku_project', sa.Column('Party_A_people', sa.String(length=20), nullable=True, comment='签约甲方联系人'))
op.add_column('siku_project', sa.Column('Party_A_mobile', sa.String(length=20), nullable=True, comment='签约甲方联系方式'))
op.add_column('siku_project', sa.Column('Party_B_name', sa.String(length=20), nullable=True, comment='签约乙方名称'))
op.add_column('siku_project', sa.Column('Party_B_people', sa.String(length=20), nullable=True, comment='签约乙方联系人'))
op.add_column('siku_project', sa.Column('Party_B_mobile', sa.String(length=20), nullable=True, comment='签约乙方联系方式'))
op.add_column('siku_project', sa.Column('sign_time', sa.DateTime(), nullable=True, comment='签约时间'))
op.add_column('siku_project', sa.Column('investment', sa.String(length=20), nullable=True, comment='到位资金'))
op.add_column('siku_project', sa.Column('project_to_area1', sa.String(length=20), nullable=True, comment='落地区域'))
op.add_column('siku_project', sa.Column('start_time', sa.DateTime(), nullable=True, comment='开工时间'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('siku_project', 'start_time')
op.drop_column('siku_project', 'project_to_area1')
op.drop_column('siku_project', 'investment')
op.drop_column('siku_project', 'sign_time')
op.drop_column('siku_project', 'Party_B_mobile')
op.drop_column('siku_project', 'Party_B_people')
op.drop_column('siku_project', 'Party_B_name')
op.drop_column('siku_project', 'Party_A_mobile')
op.drop_column('siku_project', 'Party_A_people')
op.drop_column('siku_project', 'Party_A_name')
op.drop_column('siku_project', 'progress_condition')
op.drop_column('siku_project', 'attract_name')
op.drop_column('siku_project', 'project_people_mobile')
op.drop_column('siku_project', 'project_people_unity')
op.drop_column('siku_project', 'project_people')
op.drop_column('siku_project', 'joint_person_mobile')
op.drop_column('siku_project', 'joint_person_unity')
op.drop_column('siku_project', 'joint_person')
op.drop_column('siku_project', 'project_stalker')
op.drop_column('siku_project', 'project_problem')
op.drop_column('siku_project', 'joint_condition')
op.drop_column('siku_project', 'project_address')
op.drop_column('siku_project', 'development_area')
op.drop_column('siku_project', 'project_to_area')
op.drop_column('siku_project', 'is_delete')
# ### end Alembic commands ###
"""empty message
Revision ID: 87819a1875a3
Revises: 8b6061dfb1b3
Create Date: 2023-01-04 15:53:27.713413
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '87819a1875a3'
down_revision = '8b6061dfb1b3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user', 'is_delete')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user', sa.Column('is_delete', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True, comment='逻辑删除 1是0否'))
# ### end Alembic commands ###
"""empty message
Revision ID: 8805cd14ed4c
Revises: 1b90a0436228
Create Date: 2023-02-02 16:35:10.627449
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '8805cd14ed4c'
down_revision = '1b90a0436228'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('enterprise', 'sxonhun',
existing_type=mysql.VARCHAR(length=32),
comment='是否山西100强',
existing_nullable=True)
op.alter_column('enterprise', 'scale',
existing_type=mysql.VARCHAR(length=32),
comment='规模以上企业',
existing_nullable=True)
op.alter_column('enterprise', 'serve',
existing_type=mysql.VARCHAR(length=32),
comment='限额以上服务业',
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('enterprise', 'serve',
existing_type=mysql.VARCHAR(length=32),
comment=None,
existing_comment='限额以上服务业',
existing_nullable=True)
op.alter_column('enterprise', 'scale',
existing_type=mysql.VARCHAR(length=32),
comment=None,
existing_comment='规模以上企业',
existing_nullable=True)
op.alter_column('enterprise', 'sxonhun',
existing_type=mysql.VARCHAR(length=32),
comment=None,
existing_comment='是否山西100强',
existing_nullable=True)
# ### end Alembic commands ###
"""empty message
Revision ID: 8b6061dfb1b3
Revises: 736c3275e5f3
Create Date: 2023-01-04 15:41:40.108911
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8b6061dfb1b3'
down_revision = '736c3275e5f3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user', sa.Column('is_delete', sa.Integer(), nullable=True, comment='逻辑删除 1是0否'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user', 'is_delete')
# ### end Alembic commands ###
"""empty message
Revision ID: 8ba3c2cfae73
Revises: 7e6423c3625b
Create Date: 2023-02-15 18:31:41.928731
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8ba3c2cfae73'
down_revision = '7e6423c3625b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('induzone', sa.Column('xiaqu_area', sa.Float(), nullable=True, comment='辖区面积(平方公里)'))
op.add_column('induzone', sa.Column('people_num', sa.Float(), nullable=True, comment='人口'))
op.add_column('induzone', sa.Column('carrier_form', sa.String(length=30), nullable=True, comment='载体形态'))
op.add_column('induzone', sa.Column('area_structure', sa.Float(), nullable=True, comment='辖区面积(平方公里)'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('induzone', 'area_structure')
op.drop_column('induzone', 'carrier_form')
op.drop_column('induzone', 'people_num')
op.drop_column('induzone', 'xiaqu_area')
# ### end Alembic commands ###
"""empty message
Revision ID: 92105a57ac34
Revises: 031a5f982fc2
Create Date: 2023-09-25 10:19:14.198953
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '92105a57ac34'
down_revision = '031a5f982fc2'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('examine', sa.Column('time', sa.String(length=30), nullable=True, comment='标题的时间'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('examine', 'time')
# ### end Alembic commands ###
"""empty message
Revision ID: 9389167fc068
Revises: d074791595d8
Create Date: 2023-04-12 16:38:11.380389
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9389167fc068'
down_revision = 'd074791595d8'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('induzone', sa.Column('admin_live_water1', sa.String(length=255), nullable=True, comment='行政区-居民生活用水(元/立方米)'))
op.add_column('induzone', sa.Column('admin_live_water2', sa.String(length=255), nullable=True, comment='行政区-非居民用水(元/立方米)'))
op.add_column('induzone', sa.Column('admin_live_water3', sa.String(length=255), nullable=True, comment='行政区-特种用水(元/立方米)'))
op.add_column('induzone', sa.Column('admin_electric1', sa.String(length=255), nullable=True, comment='行政区-居民生活电价'))
op.add_column('induzone', sa.Column('admin_electric2', sa.String(length=255), nullable=True, comment='行政区-商业电价'))
op.add_column('induzone', sa.Column('admin_electric3', sa.String(length=255), nullable=True, comment='行政区-工业电价'))
op.add_column('induzone', sa.Column('admin_gas1', sa.String(length=255), nullable=True, comment='行政区-城市居民用气(元/立方米)'))
op.add_column('induzone', sa.Column('admin_gas2', sa.String(length=255), nullable=True, comment='行政区-工商业用气(元/立方米)'))
op.add_column('induzone', sa.Column('admin_residence1', sa.String(length=255), nullable=True, comment='行政区-居民住宅(元/平方米)'))
op.add_column('induzone', sa.Column('admin_residence2', sa.String(length=255), nullable=True, comment='行政区-非居民住宅(元/平方米)'))
op.add_column('induzone', sa.Column('admin_tax_rate', sa.String(length=255), nullable=True, comment='行政区-企业职工各种费率(人社局)'))
op.add_column('induzone', sa.Column('admin_wage_level', sa.String(length=255), nullable=True, comment='行政区-工资标准(人社局)'))
op.add_column('induzone', sa.Column('zone_status', sa.String(length=255), nullable=True, comment='产业园区-载体形态(楼宇/厂房)'))
op.add_column('induzone', sa.Column('zone_land_area', sa.String(length=255), nullable=True, comment='产业园区-占地面积(平方公里)'))
op.add_column('induzone', sa.Column('zone_structure_area', sa.String(length=255), nullable=True, comment='产业园区-建筑面积(平方公里)'))
op.add_column('induzone', sa.Column('zone_linkman', sa.String(length=255), nullable=True, comment='产业园区-联系人(招商负责人)'))
op.add_column('induzone', sa.Column('zone_mobile', sa.String(length=255), nullable=True, comment='产业园区-联系方式(招商负责人)'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('induzone', 'zone_mobile')
op.drop_column('induzone', 'zone_linkman')
op.drop_column('induzone', 'zone_structure_area')
op.drop_column('induzone', 'zone_land_area')
op.drop_column('induzone', 'zone_status')
op.drop_column('induzone', 'admin_wage_level')
op.drop_column('induzone', 'admin_tax_rate')
op.drop_column('induzone', 'admin_residence2')
op.drop_column('induzone', 'admin_residence1')
op.drop_column('induzone', 'admin_gas2')
op.drop_column('induzone', 'admin_gas1')
op.drop_column('induzone', 'admin_electric3')
op.drop_column('induzone', 'admin_electric2')
op.drop_column('induzone', 'admin_electric1')
op.drop_column('induzone', 'admin_live_water3')
op.drop_column('induzone', 'admin_live_water2')
op.drop_column('induzone', 'admin_live_water1')
# ### end Alembic commands ###
"""empty message
Revision ID: 972efac77f90
Revises: e460c1f0a941
Create Date: 2023-02-24 16:57:51.656875
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '972efac77f90'
down_revision = 'e460c1f0a941'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('enterprise_ibfk_1', 'enterprise', type_='foreignkey')
op.drop_column('enterprise', 'industry_chain_id')
op.alter_column('introduction_meet', 'flag',
existing_type=mysql.INTEGER(display_width=11),
comment='推介会类型 1往期,2即将举办',
existing_comment='推介会类型',
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('introduction_meet', 'flag',
existing_type=mysql.INTEGER(display_width=11),
comment='推介会类型',
existing_comment='推介会类型 1往期,2即将举办',
existing_nullable=True)
op.add_column('enterprise', sa.Column('industry_chain_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
op.create_foreign_key('enterprise_ibfk_1', 'enterprise', 'industry_chain', ['industry_chain_id'], ['id'])
# ### end Alembic commands ###
"""empty message
Revision ID: 99e2ef03b89c
Revises: d6c81d2c0cdd
Create Date: 2022-12-09 15:12:24.958179
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '99e2ef03b89c'
down_revision = 'd6c81d2c0cdd'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('industry_chain',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('industry_name', sa.String(length=20), nullable=True, comment='行业名称'),
sa.Column('industry_type', sa.Integer(), nullable=True, comment='行业类型(0是产业集群,1是上游行业,2是中游行业,3是下游行业)'),
sa.Column('relate_id', sa.Integer(), nullable=True, comment='关系id(关联与哪个产业环节'),
sa.PrimaryKeyConstraint('id'),
comment='新版产业链数据数据表'
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('industry_chain')
# ### end Alembic commands ###
"""empty message
Revision ID: 9ef30d50f9e0
Revises: 87819a1875a3
Create Date: 2023-01-05 11:46:45.226510
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9ef30d50f9e0'
down_revision = '87819a1875a3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('industry_chain', sa.Column('status', sa.Integer(), nullable=True, comment='启用状态1启用,2禁用'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('industry_chain', 'status')
# ### end Alembic commands ###
"""empty message
Revision ID: a2a846da1ccd
Revises: 3913b03bf96a
Create Date: 2023-02-26 10:42:03.516467
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a2a846da1ccd'
down_revision = '3913b03bf96a'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('customer_consultation', sa.Column('consultation_time', sa.DateTime(), nullable=True, comment='咨询时间'))
op.add_column('customer_consultation', sa.Column('reply_time', sa.DateTime(), nullable=True, comment='回复时间'))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('customer_consultation', 'reply_time')
op.drop_column('customer_consultation', 'consultation_time')
# ### end Alembic commands ###
"""empty message
Revision ID: a96dec87213e
Revises: 16fd9d84e92d
Create Date: 2023-02-23 18:49:46.888528
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a96dec87213e'
down_revision = '16fd9d84e92d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('user_project',
sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('factory_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['factory_id'], ['project.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('user_id', 'factory_id')
)
op.create_table('user_zone',
sa.Column('create_time', sa.DateTime(), nullable=True, comment='创建时间'),
sa.Column('update_time', sa.DateTime(), nullable=True, comment='更新时间'),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('factory_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['factory_id'], ['induzone.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('user_id', 'factory_id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('user_zone')
op.drop_table('user_project')
# ### end Alembic commands ###
"""empty message
Revision ID: aee7c7c614f7
Revises: 972efac77f90
Create Date: 2023-02-24 18:10:25.302072
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'aee7c7c614f7'
down_revision = '972efac77f90'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('enterprise', sa.Column('company_id', sa.Integer(), nullable=True, comment='企业id'))
op.create_index(op.f('ix_enterprise_company_id'), 'enterprise', ['company_id'], unique=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_enterprise_company_id'), table_name='enterprise')
op.drop_column('enterprise', 'company_id')
# ### end Alembic commands ###
"""empty message
Revision ID: b585af1123cc
Revises: c5717f535139
Create Date: 2023-01-04 10:02:00.258236
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b585af1123cc'
down_revision = 'c5717f535139'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user', sa.Column('org_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'user', 'organization_chart', ['org_id'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'user', type_='foreignkey')
op.drop_column('user', 'org_id')
# ### end Alembic commands ###
"""empty message
Revision ID: b9af264d3544
Revises: 6af94c9dab96
Create Date: 2022-11-24 09:50:34.689852
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b9af264d3544'
down_revision = '6af94c9dab96'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('shanxi_target',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键id'),
sa.Column('file_name', sa.String(length=30), nullable=True, comment='文件名称'),
sa.Column('data_time', sa.String(length=30), nullable=True, comment='数据年份'),
sa.Column('upload_time', sa.String(length=30), nullable=True, comment='上传日期'),
sa.Column('upload_unit', sa.String(length=30), nullable=True, comment='上传部门'),
sa.Column('upload_people', sa.String(length=30), nullable=True, comment='上传人'),
sa.Column('sign_money', sa.Float(), nullable=True, comment='签约金额'),
sa.Column('sign_target_money', sa.Float(), nullable=True, comment='目标金额'),
sa.Column('sign_finish_rate', sa.Float(), nullable=True, comment='完成率'),
sa.Column('plan_invest_money', sa.Float(), nullable=True, comment='计划投资额'),
sa.Column('plan_target_money', sa.Float(), nullable=True, comment='目标计划投资额'),
sa.Column('plan_finish_rate', sa.Float(), nullable=True, comment='计划投资额完成率'),
sa.Column('arrive_money', sa.Float(), nullable=True, comment='资金到位'),
sa.Column('arrive_target_money', sa.Float(), nullable=True, comment='目标资金到位'),
sa.Column('arrive_finish_rate', sa.Float(), nullable=True, comment='计划投资额完成率'),
sa.PrimaryKeyConstraint('id'),
comment='项目化管理-山西省地市指标表'
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('shanxi_target')
# ### end Alembic commands ###
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment