Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
install.api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Script
install.api
Commits
468aa76c
Commit
468aa76c
authored
Apr 09, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表结构兼容
提交数据库配置的时候 去空格
parent
7b362c71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
conncetion_service.py
app/conncetion/conncetion_service.py
+4
-0
flask_app.py
flask_app.py
+8
-1
No files found.
app/conncetion/conncetion_service.py
View file @
468aa76c
...
...
@@ -91,6 +91,8 @@ values
# 写入
with
open
(
project_info_path
,
"w"
)
as
f
:
for
k
,
v
in
data
.
items
():
if
isinstance
(
v
,
str
):
v
=
v
.
strip
()
k
=
self
.
math_name
(
k
)
if
k
in
[
'ID'
,
'CREATE_TIME'
]:
continue
...
...
@@ -276,6 +278,8 @@ values
# 写入
with
open
(
remote_db_info_path
,
"w"
)
as
f
:
for
k
,
v
in
json_data
.
items
():
if
isinstance
(
v
,
str
):
v
=
v
.
strip
()
k
=
self
.
math_name
(
k
)
if
k
in
[
'ID'
,
'CREATE_TIME'
]:
continue
...
...
flask_app.py
View file @
468aa76c
...
...
@@ -2,7 +2,7 @@ import os
import
git
from
flask
import
Flask
from
huansi_utils.app.apploader
import
AppLoaderBase
from
huansi_utils.app.apploader
import
AppLoaderBase
,
logger
from
huansi_utils.db.sqlalchemy
import
db
from
huansi_utils.flask_docs
import
ApiDoc
...
...
@@ -33,6 +33,13 @@ class FlashAppLoader(AppLoaderBase):
for
create_table_sql
in
create_table_sql_list
:
session
.
exec_sql
(
create_table_sql
)
# 增加字段
try
:
session
.
retrive_sql
(
'select work_shop_no from remote_server_info'
)
except
Exception
as
e
:
logger
.
info
(
f
'兼容表结构报错:{e}'
)
session
.
exec_sql
(
'ALTER TABLE remote_server_info ADD COLUMN work_shop_no varchar(50)'
)
# 兼容之前的db配置
from
app.conncetion.conncetion_service
import
ConnectionService
ConnectionService
()
.
sync_remote_db_info
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment