mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-03 13:28:19 +00:00
ifc2sql - fix should_get_inverses for mysql
This commit is contained in:
@@ -475,15 +475,18 @@ class Patcher(ifcpatch.BasePatcher):
|
|||||||
elif isinstance(primitive, tuple):
|
elif isinstance(primitive, tuple):
|
||||||
data_type = "JSON"
|
data_type = "JSON"
|
||||||
else:
|
else:
|
||||||
print(attribute, primitive) # Not implemented?
|
print("Possibly not implemented attribute data type:", attribute, primitive)
|
||||||
if not self.is_strict or derived[i]:
|
if not self.is_strict or derived[i]:
|
||||||
optional = "DEFAULT NULL"
|
optional = "DEFAULT NULL"
|
||||||
else:
|
else:
|
||||||
optional = "DEFAULT NULL" if attribute.optional() else "NOT NULL"
|
optional = "DEFAULT NULL" if attribute.optional() else "NOT NULL"
|
||||||
statement += f" `{attribute.name()}` {data_type} {optional},"
|
statement += f" `{attribute.name()}` {data_type} {optional},"
|
||||||
|
|
||||||
|
if self.should_get_inverses:
|
||||||
|
statement += "inverses JSON, "
|
||||||
|
|
||||||
if self.should_expand:
|
if self.should_expand:
|
||||||
statement = statement[0:-1]
|
statement = statement.removesuffix(",")
|
||||||
else:
|
else:
|
||||||
statement += " PRIMARY KEY (`ifc_id`)"
|
statement += " PRIMARY KEY (`ifc_id`)"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user