개정판 bd1985ec
issue #1171: fix db connection info saving
Change-Id: I7863f2dbc6bcbe562eb7938afdc10f7579b25bc9
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
1031 | 1031 |
cur = conn.cursor() |
1032 | 1032 |
cur.execute(sql, (nowDate, project.desc, project.prj_unit, project.getId())) |
1033 | 1033 |
|
1034 |
sql = 'update DBSettings set DBTypes_UID=(select UID from DBTypes where Name=?),Host=?,User=?,Password=? where Projects_UID=?'
|
|
1034 |
sql = 'insert or replace into DBSettings(Projects_UID, DBTypes_UID, Host, User, Password, FilePath) values(?,(select UID from DBTypes where Name=?),?,?,?,?)'
|
|
1035 | 1035 |
cur = conn.cursor() |
1036 |
cur.execute(sql, (project.database.db_type, project.database.host, project.database.user, project.database.password, project.getId()))
|
|
1036 |
cur.execute(sql, (project.getId(), project.database.db_type, project.database.host, project.database.user, project.database.password, project.database.file_path))
|
|
1037 | 1037 |
conn.commit() |
1038 | 1038 |
except Exception as ex: |
1039 | 1039 |
# Roll back any change if something goes wrong |
DTI_PID/DTI_PID/Scripts/Project.Projects.sql | ||
---|---|---|
17 | 17 |
INSERT INTO DBTypes(Name) select 'MSSQL' where not exists(select 1 from DBTypes where Name='MSSQL'); |
18 | 18 |
|
19 | 19 |
CREATE TABLE IF NOT EXISTS DBSettings ( |
20 |
UID INTEGER PRIMARY KEY AUTOINCREMENT |
|
21 |
NOT NULL, |
|
22 | 20 |
Projects_UID INTEGER REFERENCES Projects (Id) |
23 |
NOT NULL, |
|
21 |
NOT NULL |
|
22 |
PRIMARY KEY, |
|
24 | 23 |
DBTypes_UID INTEGER REFERENCES DBTypes (UID) |
25 | 24 |
NOT NULL, |
26 | 25 |
Host TEXT, |
내보내기 Unified diff