mirror of
https://github.com/correl/mtgsqlive.git
synced 2024-11-25 11:09:51 +00:00
ENUM options fix (#53)
This commit is contained in:
parent
26650c1a05
commit
0b46d58d29
1 changed files with 2 additions and 0 deletions
|
@ -120,6 +120,8 @@ def get_query_from_dict(tables, distro):
|
||||||
else:
|
else:
|
||||||
q += " id INTEGER PRIMARY KEY AUTO_INCREMENT,\n"
|
q += " id INTEGER PRIMARY KEY AUTO_INCREMENT,\n"
|
||||||
for colName in sorted(tableData.keys()):
|
for colName in sorted(tableData.keys()):
|
||||||
|
if tableData[colName]["type"] == "ENUM" and not "options" in tableData[colName]:
|
||||||
|
tableData[colName]["type"] = "TEXT"
|
||||||
q += f" {colName} {tableData[colName]['type']}"
|
q += f" {colName} {tableData[colName]['type']}"
|
||||||
if tableData[colName]["type"] == "ENUM":
|
if tableData[colName]["type"] == "ENUM":
|
||||||
q += "('" + "', '".join(tableData[colName]["options"]) + "')"
|
q += "('" + "', '".join(tableData[colName]["options"]) + "')"
|
||||||
|
|
Loading…
Reference in a new issue