| """ | |
| Schema definition for persons. | |
| Update this file when adding new fields to the person data model. | |
| """ | |
| from schemas.base import SchemaDefinition | |
| # Define the person schema | |
| PERSON_SCHEMA = SchemaDefinition( | |
| table_name='persons', | |
| schema={ | |
| 'id': 'VARCHAR PRIMARY KEY', | |
| 'first_name': 'VARCHAR', | |
| 'last_name': 'VARCHAR', | |
| 'name_suffix': 'VARCHAR', | |
| # Add new fields here as needed: | |
| # 'middle_name': 'VARCHAR', | |
| # 'birth_date': 'DATE', | |
| # 'positions': 'JSON', # For nested arrays of positions | |
| # 'addresses': 'JSON', # For nested address objects | |
| # etc. | |
| }, | |
| field_order=['id', 'first_name', 'last_name', 'name_suffix'], | |
| nested_fields=set([ | |
| # Add nested field names here: | |
| # 'positions', | |
| # 'addresses', | |
| # 'metadata', | |
| ]) | |
| ) | |