0

I got this table:

id name
0 0 Region_0
1 1 Region_1
2 2 Region_2
3 3 Region_3
4 4 Region_4
5 5 Region_5
6 6 Region_6
7 7 Region_7
8 8 Region_8
9 9 Region_9
10 10 Region_10
11 11 Region_11
12 12 Region_12
13 13 Region_13
14 14 Region_14
15 15 Region_15
16 16 Region_16
17 17 Region_17
18 18 Region_18
19 19 Region_19

I trying to make new data. Metadata for this table:

database_metadata.update_column(
    table_name='region',
    column_name='id',
    sdtype='id',
    regex_format='[0-9]{2}'
)

database_metadata.set_primary_key(
    table_name='region',
    column_name='id'
)

database_metadata.add_relationship(
    parent_table_name='region',
    child_table_name='users',
    parent_primary_key='id',
    child_foreign_key='region_id'
)


'region': {'primary_key': 'id',
   'columns': {'id': {'sdtype': 'id', 'regex_format': '[0-9]{2}'},
    'name': {'sdtype': 'categorical'}}}

I need to make region's names unique. How to put this logic in model?

P.S. The constraint class 'Unique' is not currently supported for multi-table synthesizers.

John Doe
  • 95
  • 6

0 Answers0