Skip to content

Commit

Permalink
fix fk on windows-pebinary
Browse files Browse the repository at this point in the history
  • Loading branch information
rpiazza committed Apr 7, 2024
1 parent 3042ddc commit 06b3d5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stix2/datastore/relational_db/input_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def generate_insert_information(self, name, stix_object, data_sink=None, table_n
input_statements = list()
for ex_name, ex in stix_object["extensions"].items():
# ignore new extensions - they have no properties
if ex.extension_type and not ex.extension_type.startswith("new"):
if ex.extension_type is None or not ex.extension_type.startswith("new"):
if ex_name.startswith("extension-definition"):
ex_name = ex_name[0:30]
ex_name = ex_name.replace("extension-definition-", "ext_def")
Expand Down
4 changes: 2 additions & 2 deletions stix2/datastore/relational_db/table_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def create_hashes_table(name, metadata, schema_name, table_name, key_type=Text,
columns = list()
# special case, perhaps because its a single embedded object with hashes, and not a list of embedded object
# making the parent table's primary key does seem to worl
if table_name == "windows-pebinary-ext_WindowsPEOptionalHeaderType":
if False: # table_name == "windows-pebinary-ext_WindowsPEOptionalHeaderType":
columns.append(
Column(
"id",
Expand Down Expand Up @@ -737,7 +737,7 @@ def generate_object_table(
ondelete="CASCADE",
),
# if it is a not list, then it is a single embedded object, and the primary key is unique
# primary_key=not is_list
primary_key=not is_list
)
elif level > 0 and is_embedded_object:
column = Column(
Expand Down

0 comments on commit 06b3d5a

Please sign in to comment.