|
5 | 5 |
|
6 | 6 | from stix2.datastore.relational_db.add_method import add_method |
7 | 7 | from stix2.datastore.relational_db.utils import ( |
8 | | - SCO_COMMON_PROPERTIES, SDO_COMMON_PROPERTIES, canonicalize_table_name, |
9 | | - determine_column_name, determine_sql_type_from_stix, flat_classes, |
10 | | - get_stix_object_classes, shorten_extension_definition_id |
| 8 | + canonicalize_table_name, determine_column_name, determine_core_properties, determine_sql_type_from_stix, |
| 9 | + flat_classes, get_stix_object_classes, shorten_extension_definition_id |
11 | 10 | ) |
12 | 11 | from stix2.properties import ( |
13 | 12 | BinaryProperty, BooleanProperty, DictionaryProperty, |
|
16 | 15 | ObjectReferenceProperty, Property, ReferenceProperty, StringProperty, |
17 | 16 | TimestampProperty, TypeProperty, |
18 | 17 | ) |
19 | | -from stix2.v21.base import _Extension, _Observable |
| 18 | + |
| 19 | +from stix2.v21.base import (_Extension, _Observable) |
20 | 20 | from stix2.v21.common import KillChainPhase |
21 | 21 |
|
22 | 22 |
|
@@ -809,14 +809,7 @@ def generate_object_table( |
809 | 809 | table_name = shorten_extension_definition_id(table_name) |
810 | 810 | if parent_table_name: |
811 | 811 | table_name = parent_table_name + "_" + table_name |
812 | | - if is_embedded_object: |
813 | | - core_properties = list() |
814 | | - elif schema_name in ["sdo", "sro", "common"]: |
815 | | - core_properties = SDO_COMMON_PROPERTIES |
816 | | - elif schema_name == "sco": |
817 | | - core_properties = SCO_COMMON_PROPERTIES |
818 | | - else: |
819 | | - core_properties = list() |
| 812 | + core_properties = determine_core_properties(stix_object_class, is_embedded_object) |
820 | 813 | columns = list() |
821 | 814 | tables = list() |
822 | 815 | if issubclass(stix_object_class, _Observable): |
|
0 commit comments