Files
leistungsbilanz-ts/src/db/migrations/meta/0011_snapshot.json
T

1450 lines
39 KiB
JSON

{
"version": "6",
"dialect": "sqlite",
"id": "863215c4-ed6e-4ec5-8c48-161054031da2",
"prevId": "d219f155-9dd0-48e3-8fd2-8278f1f788ca",
"tables": {
"circuit_device_rows": {
"name": "circuit_device_rows",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"circuit_id": {
"name": "circuit_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"linked_project_device_id": {
"name": "linked_project_device_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"legacy_consumer_id": {
"name": "legacy_consumer_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"sort_order": {
"name": "sort_order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"display_name": {
"name": "display_name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"phase_type": {
"name": "phase_type",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"connection_kind": {
"name": "connection_kind",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"cost_group": {
"name": "cost_group",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"level": {
"name": "level",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"room_id": {
"name": "room_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"room_number_snapshot": {
"name": "room_number_snapshot",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"room_name_snapshot": {
"name": "room_name_snapshot",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"quantity": {
"name": "quantity",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"power_per_unit": {
"name": "power_per_unit",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"simultaneity_factor": {
"name": "simultaneity_factor",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"cos_phi": {
"name": "cos_phi",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"remark": {
"name": "remark",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"overridden_fields": {
"name": "overridden_fields",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"circuit_device_rows_circuit_id_circuits_id_fk": {
"name": "circuit_device_rows_circuit_id_circuits_id_fk",
"tableFrom": "circuit_device_rows",
"tableTo": "circuits",
"columnsFrom": [
"circuit_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"circuit_device_rows_linked_project_device_id_project_devices_id_fk": {
"name": "circuit_device_rows_linked_project_device_id_project_devices_id_fk",
"tableFrom": "circuit_device_rows",
"tableTo": "project_devices",
"columnsFrom": [
"linked_project_device_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"circuit_device_rows_room_id_rooms_id_fk": {
"name": "circuit_device_rows_room_id_rooms_id_fk",
"tableFrom": "circuit_device_rows",
"tableTo": "rooms",
"columnsFrom": [
"room_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"circuit_lists": {
"name": "circuit_lists",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"distribution_board_id": {
"name": "distribution_board_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"circuit_lists_distribution_board_id_unique": {
"name": "circuit_lists_distribution_board_id_unique",
"columns": [
"distribution_board_id"
],
"isUnique": true
}
},
"foreignKeys": {
"circuit_lists_project_id_projects_id_fk": {
"name": "circuit_lists_project_id_projects_id_fk",
"tableFrom": "circuit_lists",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"circuit_lists_distribution_board_id_distribution_boards_id_fk": {
"name": "circuit_lists_distribution_board_id_distribution_boards_id_fk",
"tableFrom": "circuit_lists",
"tableTo": "distribution_boards",
"columnsFrom": [
"distribution_board_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"circuit_sections": {
"name": "circuit_sections",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"circuit_list_id": {
"name": "circuit_list_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"key": {
"name": "key",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"display_name": {
"name": "display_name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"prefix": {
"name": "prefix",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"sort_order": {
"name": "sort_order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
}
},
"indexes": {
"circuit_sections_list_key_unique": {
"name": "circuit_sections_list_key_unique",
"columns": [
"circuit_list_id",
"key"
],
"isUnique": true
},
"circuit_sections_list_prefix_unique": {
"name": "circuit_sections_list_prefix_unique",
"columns": [
"circuit_list_id",
"prefix"
],
"isUnique": true
}
},
"foreignKeys": {
"circuit_sections_circuit_list_id_circuit_lists_id_fk": {
"name": "circuit_sections_circuit_list_id_circuit_lists_id_fk",
"tableFrom": "circuit_sections",
"tableTo": "circuit_lists",
"columnsFrom": [
"circuit_list_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"circuits": {
"name": "circuits",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"circuit_list_id": {
"name": "circuit_list_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"section_id": {
"name": "section_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"equipment_identifier": {
"name": "equipment_identifier",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"display_name": {
"name": "display_name",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"sort_order": {
"name": "sort_order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"protection_type": {
"name": "protection_type",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"protection_rated_current": {
"name": "protection_rated_current",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"protection_characteristic": {
"name": "protection_characteristic",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"cable_type": {
"name": "cable_type",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"cable_cross_section": {
"name": "cable_cross_section",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"cable_length": {
"name": "cable_length",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"rcd_assignment": {
"name": "rcd_assignment",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"terminal_designation": {
"name": "terminal_designation",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"voltage": {
"name": "voltage",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"control_requirement": {
"name": "control_requirement",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"is_reserve": {
"name": "is_reserve",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"remark": {
"name": "remark",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"circuits_list_equipment_identifier_unique": {
"name": "circuits_list_equipment_identifier_unique",
"columns": [
"circuit_list_id",
"equipment_identifier"
],
"isUnique": true
}
},
"foreignKeys": {
"circuits_circuit_list_id_circuit_lists_id_fk": {
"name": "circuits_circuit_list_id_circuit_lists_id_fk",
"tableFrom": "circuits",
"tableTo": "circuit_lists",
"columnsFrom": [
"circuit_list_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"circuits_section_id_circuit_sections_id_fk": {
"name": "circuits_section_id_circuit_sections_id_fk",
"tableFrom": "circuits",
"tableTo": "circuit_sections",
"columnsFrom": [
"section_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"consumers": {
"name": "consumers",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"distribution_board_id": {
"name": "distribution_board_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"circuit_list_id": {
"name": "circuit_list_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"project_device_id": {
"name": "project_device_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"is_linked_to_device": {
"name": "is_linked_to_device",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"room_id": {
"name": "room_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"circuit_number": {
"name": "circuit_number",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"device_type": {
"name": "device_type",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"phase_type": {
"name": "phase_type",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"trade_or_cost_group": {
"name": "trade_or_cost_group",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"group_name": {
"name": "group_name",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"protection_type": {
"name": "protection_type",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"protection_rated_current": {
"name": "protection_rated_current",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"protection_characteristic": {
"name": "protection_characteristic",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"cable_type": {
"name": "cable_type",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"cable_cross_section": {
"name": "cable_cross_section",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"comment": {
"name": "comment",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"quantity": {
"name": "quantity",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"installed_power_per_unit_kw": {
"name": "installed_power_per_unit_kw",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"demand_factor": {
"name": "demand_factor",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"voltage_v": {
"name": "voltage_v",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"phase_count": {
"name": "phase_count",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"power_factor": {
"name": "power_factor",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"note": {
"name": "note",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"consumers_project_id_projects_id_fk": {
"name": "consumers_project_id_projects_id_fk",
"tableFrom": "consumers",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"consumers_distribution_board_id_distribution_boards_id_fk": {
"name": "consumers_distribution_board_id_distribution_boards_id_fk",
"tableFrom": "consumers",
"tableTo": "distribution_boards",
"columnsFrom": [
"distribution_board_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"consumers_circuit_list_id_circuit_lists_id_fk": {
"name": "consumers_circuit_list_id_circuit_lists_id_fk",
"tableFrom": "consumers",
"tableTo": "circuit_lists",
"columnsFrom": [
"circuit_list_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"consumers_project_device_id_project_devices_id_fk": {
"name": "consumers_project_device_id_project_devices_id_fk",
"tableFrom": "consumers",
"tableTo": "project_devices",
"columnsFrom": [
"project_device_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"consumers_room_id_rooms_id_fk": {
"name": "consumers_room_id_rooms_id_fk",
"tableFrom": "consumers",
"tableTo": "rooms",
"columnsFrom": [
"room_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"distribution_boards": {
"name": "distribution_boards",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"distribution_boards_project_id_projects_id_fk": {
"name": "distribution_boards_project_id_projects_id_fk",
"tableFrom": "distribution_boards",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"floors": {
"name": "floors",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"sort_order": {
"name": "sort_order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
}
},
"indexes": {},
"foreignKeys": {
"floors_project_id_projects_id_fk": {
"name": "floors_project_id_projects_id_fk",
"tableFrom": "floors",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"global_devices": {
"name": "global_devices",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"display_name": {
"name": "display_name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"quantity": {
"name": "quantity",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"installed_power_per_unit_kw": {
"name": "installed_power_per_unit_kw",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"demand_factor": {
"name": "demand_factor",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"voltage_v": {
"name": "voltage_v",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"phase_count": {
"name": "phase_count",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"power_factor": {
"name": "power_factor",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"note": {
"name": "note",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"legacy_consumer_circuit_migrations": {
"name": "legacy_consumer_circuit_migrations",
"columns": {
"consumer_id": {
"name": "consumer_id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"circuit_id": {
"name": "circuit_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"circuit_device_row_id": {
"name": "circuit_device_row_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"circuit_list_id": {
"name": "circuit_list_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at_iso": {
"name": "created_at_iso",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"legacy_consumer_circuit_migrations_circuit_id_circuits_id_fk": {
"name": "legacy_consumer_circuit_migrations_circuit_id_circuits_id_fk",
"tableFrom": "legacy_consumer_circuit_migrations",
"tableTo": "circuits",
"columnsFrom": [
"circuit_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"legacy_consumer_circuit_migrations_circuit_device_row_id_circuit_device_rows_id_fk": {
"name": "legacy_consumer_circuit_migrations_circuit_device_row_id_circuit_device_rows_id_fk",
"tableFrom": "legacy_consumer_circuit_migrations",
"tableTo": "circuit_device_rows",
"columnsFrom": [
"circuit_device_row_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"legacy_consumer_circuit_migrations_circuit_list_id_circuit_lists_id_fk": {
"name": "legacy_consumer_circuit_migrations_circuit_list_id_circuit_lists_id_fk",
"tableFrom": "legacy_consumer_circuit_migrations",
"tableTo": "circuit_lists",
"columnsFrom": [
"circuit_list_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"legacy_consumer_migration_reports": {
"name": "legacy_consumer_migration_reports",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"circuit_list_id": {
"name": "circuit_list_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"legacy_consumer_count": {
"name": "legacy_consumer_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_circuit_count": {
"name": "created_circuit_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_device_row_count": {
"name": "created_device_row_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"duplicate_grouped_count": {
"name": "duplicate_grouped_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"generated_identifier_count": {
"name": "generated_identifier_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"unassigned_row_count": {
"name": "unassigned_row_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"warnings_json": {
"name": "warnings_json",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"generated_identifiers_json": {
"name": "generated_identifiers_json",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"duplicate_groups_json": {
"name": "duplicate_groups_json",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at_iso": {
"name": "created_at_iso",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"legacy_consumer_migration_reports_list_unique": {
"name": "legacy_consumer_migration_reports_list_unique",
"columns": [
"circuit_list_id"
],
"isUnique": true
}
},
"foreignKeys": {
"legacy_consumer_migration_reports_circuit_list_id_circuit_lists_id_fk": {
"name": "legacy_consumer_migration_reports_circuit_list_id_circuit_lists_id_fk",
"tableFrom": "legacy_consumer_migration_reports",
"tableTo": "circuit_lists",
"columnsFrom": [
"circuit_list_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"project_devices": {
"name": "project_devices",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"display_name": {
"name": "display_name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"phase_type": {
"name": "phase_type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'single_phase'"
},
"connection_kind": {
"name": "connection_kind",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"cost_group": {
"name": "cost_group",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"quantity": {
"name": "quantity",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"power_per_unit": {
"name": "power_per_unit",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"simultaneity_factor": {
"name": "simultaneity_factor",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 1
},
"cos_phi": {
"name": "cos_phi",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"remark": {
"name": "remark",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"voltage_v": {
"name": "voltage_v",
"type": "real",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"project_devices_project_id_projects_id_fk": {
"name": "project_devices_project_id_projects_id_fk",
"tableFrom": "project_devices",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"projects": {
"name": "projects",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"single_phase_voltage_v": {
"name": "single_phase_voltage_v",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 230
},
"three_phase_voltage_v": {
"name": "three_phase_voltage_v",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 400
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"rooms": {
"name": "rooms",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"floor_id": {
"name": "floor_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"room_number": {
"name": "room_number",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"room_name": {
"name": "room_name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"rooms_project_id_projects_id_fk": {
"name": "rooms_project_id_projects_id_fk",
"tableFrom": "rooms",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"rooms_floor_id_floors_id_fk": {
"name": "rooms_floor_id_floors_id_fk",
"tableFrom": "rooms",
"tableTo": "floors",
"columnsFrom": [
"floor_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}