4496 lines
118 KiB
JSON
4496 lines
118 KiB
JSON
{
|
|
"id": "2ef6c9ae-30f3-48bd-95af-9103ba70baf6",
|
|
"prevId": "4d819091-9b70-4d7e-b656-4b71cff5d1a4",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"public.accounts": {
|
|
"name": "accounts",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"platform_role_id": {
|
|
"name": "platform_role_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"avatar_url": {
|
|
"name": "avatar_url",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"password_hash": {
|
|
"name": "password_hash",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"password_salt": {
|
|
"name": "password_salt",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "account_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'active'"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"accounts_email_unique": {
|
|
"name": "accounts_email_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "email",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"accounts_platform_role_id_roles_id_fk": {
|
|
"name": "accounts_platform_role_id_roles_id_fk",
|
|
"tableFrom": "accounts",
|
|
"tableTo": "roles",
|
|
"columnsFrom": [
|
|
"platform_role_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.admissions": {
|
|
"name": "admissions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"elder_id": {
|
|
"name": "elder_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"bed_id": {
|
|
"name": "bed_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "admission_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'active'"
|
|
},
|
|
"admitted_at": {
|
|
"name": "admitted_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"discharged_at": {
|
|
"name": "discharged_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"notes": {
|
|
"name": "notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"admissions_organization_id_organizations_id_fk": {
|
|
"name": "admissions_organization_id_organizations_id_fk",
|
|
"tableFrom": "admissions",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"admissions_elder_id_elders_id_fk": {
|
|
"name": "admissions_elder_id_elders_id_fk",
|
|
"tableFrom": "admissions",
|
|
"tableTo": "elders",
|
|
"columnsFrom": [
|
|
"elder_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"admissions_bed_id_beds_id_fk": {
|
|
"name": "admissions_bed_id_beds_id_fk",
|
|
"tableFrom": "admissions",
|
|
"tableTo": "beds",
|
|
"columnsFrom": [
|
|
"bed_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.alert_rules": {
|
|
"name": "alert_rules",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"rule_type": {
|
|
"name": "rule_type",
|
|
"type": "alert_rule_type",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'other'"
|
|
},
|
|
"severity": {
|
|
"name": "severity",
|
|
"type": "incident_severity",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'warning'"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "alert_rule_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'enabled'"
|
|
},
|
|
"condition_summary": {
|
|
"name": "condition_summary",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"suggestion": {
|
|
"name": "suggestion",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"alert_rules_status_lookup": {
|
|
"name": "alert_rules_status_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "rule_type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"alert_rules_organization_id_organizations_id_fk": {
|
|
"name": "alert_rules_organization_id_organizations_id_fk",
|
|
"tableFrom": "alert_rules",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.alert_triggers": {
|
|
"name": "alert_triggers",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"rule_id": {
|
|
"name": "rule_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"elder_id": {
|
|
"name": "elder_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "alert_trigger_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'open'"
|
|
},
|
|
"source": {
|
|
"name": "source",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"handled_by_account_id": {
|
|
"name": "handled_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"handled_at": {
|
|
"name": "handled_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"handling_notes": {
|
|
"name": "handling_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"alert_triggers_queue_lookup": {
|
|
"name": "alert_triggers_queue_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"alert_triggers_rule_lookup": {
|
|
"name": "alert_triggers_rule_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "rule_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"alert_triggers_organization_id_organizations_id_fk": {
|
|
"name": "alert_triggers_organization_id_organizations_id_fk",
|
|
"tableFrom": "alert_triggers",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"alert_triggers_rule_id_alert_rules_id_fk": {
|
|
"name": "alert_triggers_rule_id_alert_rules_id_fk",
|
|
"tableFrom": "alert_triggers",
|
|
"tableTo": "alert_rules",
|
|
"columnsFrom": [
|
|
"rule_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"alert_triggers_elder_id_elders_id_fk": {
|
|
"name": "alert_triggers_elder_id_elders_id_fk",
|
|
"tableFrom": "alert_triggers",
|
|
"tableTo": "elders",
|
|
"columnsFrom": [
|
|
"elder_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"alert_triggers_handled_by_account_id_accounts_id_fk": {
|
|
"name": "alert_triggers_handled_by_account_id_accounts_id_fk",
|
|
"tableFrom": "alert_triggers",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"handled_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.audit_logs": {
|
|
"name": "audit_logs",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"timestamp": {
|
|
"name": "timestamp",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"actor_account_id": {
|
|
"name": "actor_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"actor_email": {
|
|
"name": "actor_email",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"action": {
|
|
"name": "action",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"target_type": {
|
|
"name": "target_type",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"target_id": {
|
|
"name": "target_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"result": {
|
|
"name": "result",
|
|
"type": "audit_result",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"reason": {
|
|
"name": "reason",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"audit_logs_organization_id_organizations_id_fk": {
|
|
"name": "audit_logs_organization_id_organizations_id_fk",
|
|
"tableFrom": "audit_logs",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"audit_logs_actor_account_id_accounts_id_fk": {
|
|
"name": "audit_logs_actor_account_id_accounts_id_fk",
|
|
"tableFrom": "audit_logs",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"actor_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.beds": {
|
|
"name": "beds",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"room_id": {
|
|
"name": "room_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"code": {
|
|
"name": "code",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "bed_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'available'"
|
|
},
|
|
"notes": {
|
|
"name": "notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"beds_code_room_unique": {
|
|
"name": "beds_code_room_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "room_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "code",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"beds_organization_id_organizations_id_fk": {
|
|
"name": "beds_organization_id_organizations_id_fk",
|
|
"tableFrom": "beds",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"beds_room_id_rooms_id_fk": {
|
|
"name": "beds_room_id_rooms_id_fk",
|
|
"tableFrom": "beds",
|
|
"tableTo": "rooms",
|
|
"columnsFrom": [
|
|
"room_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.buildings": {
|
|
"name": "buildings",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"campus_id": {
|
|
"name": "campus_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"buildings_organization_id_organizations_id_fk": {
|
|
"name": "buildings_organization_id_organizations_id_fk",
|
|
"tableFrom": "buildings",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"buildings_campus_id_campuses_id_fk": {
|
|
"name": "buildings_campus_id_campuses_id_fk",
|
|
"tableFrom": "buildings",
|
|
"tableTo": "campuses",
|
|
"columnsFrom": [
|
|
"campus_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.campuses": {
|
|
"name": "campuses",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"address": {
|
|
"name": "address",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"campuses_organization_id_organizations_id_fk": {
|
|
"name": "campuses_organization_id_organizations_id_fk",
|
|
"tableFrom": "campuses",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.care_tasks": {
|
|
"name": "care_tasks",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"elder_id": {
|
|
"name": "elder_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"care_type": {
|
|
"name": "care_type",
|
|
"type": "care_task_type",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"priority": {
|
|
"name": "priority",
|
|
"type": "care_task_priority",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'normal'"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "care_task_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'pending'"
|
|
},
|
|
"scheduled_at": {
|
|
"name": "scheduled_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"assignee_label": {
|
|
"name": "assignee_label",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"execution_notes": {
|
|
"name": "execution_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"completed_at": {
|
|
"name": "completed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_by_account_id": {
|
|
"name": "created_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"completed_by_account_id": {
|
|
"name": "completed_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"care_tasks_queue_lookup": {
|
|
"name": "care_tasks_queue_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "priority",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"care_tasks_schedule_lookup": {
|
|
"name": "care_tasks_schedule_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "scheduled_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"care_tasks_organization_id_organizations_id_fk": {
|
|
"name": "care_tasks_organization_id_organizations_id_fk",
|
|
"tableFrom": "care_tasks",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"care_tasks_elder_id_elders_id_fk": {
|
|
"name": "care_tasks_elder_id_elders_id_fk",
|
|
"tableFrom": "care_tasks",
|
|
"tableTo": "elders",
|
|
"columnsFrom": [
|
|
"elder_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"care_tasks_created_by_account_id_accounts_id_fk": {
|
|
"name": "care_tasks_created_by_account_id_accounts_id_fk",
|
|
"tableFrom": "care_tasks",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"created_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"care_tasks_completed_by_account_id_accounts_id_fk": {
|
|
"name": "care_tasks_completed_by_account_id_accounts_id_fk",
|
|
"tableFrom": "care_tasks",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"completed_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.chronic_conditions": {
|
|
"name": "chronic_conditions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"elder_id": {
|
|
"name": "elder_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "chronic_condition_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'active'"
|
|
},
|
|
"diagnosed_at": {
|
|
"name": "diagnosed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"treatment_notes": {
|
|
"name": "treatment_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"follow_up_notes": {
|
|
"name": "follow_up_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"chronic_conditions_elder_status_lookup": {
|
|
"name": "chronic_conditions_elder_status_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "elder_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"chronic_conditions_organization_id_organizations_id_fk": {
|
|
"name": "chronic_conditions_organization_id_organizations_id_fk",
|
|
"tableFrom": "chronic_conditions",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"chronic_conditions_elder_id_elders_id_fk": {
|
|
"name": "chronic_conditions_elder_id_elders_id_fk",
|
|
"tableFrom": "chronic_conditions",
|
|
"tableTo": "elders",
|
|
"columnsFrom": [
|
|
"elder_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.device_assets": {
|
|
"name": "device_assets",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"code": {
|
|
"name": "code",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"category": {
|
|
"name": "category",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"location": {
|
|
"name": "location",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "device_asset_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'active'"
|
|
},
|
|
"last_inspected_at": {
|
|
"name": "last_inspected_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"notes": {
|
|
"name": "notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"device_assets_code_organization_unique": {
|
|
"name": "device_assets_code_organization_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "code",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"device_assets_status_lookup": {
|
|
"name": "device_assets_status_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"device_assets_organization_id_organizations_id_fk": {
|
|
"name": "device_assets_organization_id_organizations_id_fk",
|
|
"tableFrom": "device_assets",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.elders": {
|
|
"name": "elders",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"gender": {
|
|
"name": "gender",
|
|
"type": "gender",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"age": {
|
|
"name": "age",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"care_level": {
|
|
"name": "care_level",
|
|
"type": "care_level",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "elder_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'pending'"
|
|
},
|
|
"primary_contact": {
|
|
"name": "primary_contact",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"phone": {
|
|
"name": "phone",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"medical_notes": {
|
|
"name": "medical_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"elders_organization_id_organizations_id_fk": {
|
|
"name": "elders_organization_id_organizations_id_fk",
|
|
"tableFrom": "elders",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.family_contacts": {
|
|
"name": "family_contacts",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"elder_id": {
|
|
"name": "elder_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"relationship": {
|
|
"name": "relationship",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"phone": {
|
|
"name": "phone",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "family_contact_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'active'"
|
|
},
|
|
"notes": {
|
|
"name": "notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"family_contacts_elder_lookup": {
|
|
"name": "family_contacts_elder_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "elder_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"family_contacts_organization_id_organizations_id_fk": {
|
|
"name": "family_contacts_organization_id_organizations_id_fk",
|
|
"tableFrom": "family_contacts",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"family_contacts_elder_id_elders_id_fk": {
|
|
"name": "family_contacts_elder_id_elders_id_fk",
|
|
"tableFrom": "family_contacts",
|
|
"tableTo": "elders",
|
|
"columnsFrom": [
|
|
"elder_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.family_feedback": {
|
|
"name": "family_feedback",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"elder_id": {
|
|
"name": "elder_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"contact_id": {
|
|
"name": "contact_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"feedback_type": {
|
|
"name": "feedback_type",
|
|
"type": "family_feedback_type",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'other'"
|
|
},
|
|
"content": {
|
|
"name": "content",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "family_feedback_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'open'"
|
|
},
|
|
"response_notes": {
|
|
"name": "response_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"handled_by_account_id": {
|
|
"name": "handled_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"handled_at": {
|
|
"name": "handled_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"family_feedback_queue_lookup": {
|
|
"name": "family_feedback_queue_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "feedback_type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"family_feedback_organization_id_organizations_id_fk": {
|
|
"name": "family_feedback_organization_id_organizations_id_fk",
|
|
"tableFrom": "family_feedback",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"family_feedback_elder_id_elders_id_fk": {
|
|
"name": "family_feedback_elder_id_elders_id_fk",
|
|
"tableFrom": "family_feedback",
|
|
"tableTo": "elders",
|
|
"columnsFrom": [
|
|
"elder_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"family_feedback_contact_id_family_contacts_id_fk": {
|
|
"name": "family_feedback_contact_id_family_contacts_id_fk",
|
|
"tableFrom": "family_feedback",
|
|
"tableTo": "family_contacts",
|
|
"columnsFrom": [
|
|
"contact_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"family_feedback_handled_by_account_id_accounts_id_fk": {
|
|
"name": "family_feedback_handled_by_account_id_accounts_id_fk",
|
|
"tableFrom": "family_feedback",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"handled_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.family_visit_appointments": {
|
|
"name": "family_visit_appointments",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"elder_id": {
|
|
"name": "elder_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"contact_id": {
|
|
"name": "contact_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"scheduled_at": {
|
|
"name": "scheduled_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "family_visit_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'requested'"
|
|
},
|
|
"notes": {
|
|
"name": "notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"handled_by_account_id": {
|
|
"name": "handled_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"handled_at": {
|
|
"name": "handled_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"family_visit_appointments_schedule_lookup": {
|
|
"name": "family_visit_appointments_schedule_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "scheduled_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"family_visit_appointments_organization_id_organizations_id_fk": {
|
|
"name": "family_visit_appointments_organization_id_organizations_id_fk",
|
|
"tableFrom": "family_visit_appointments",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"family_visit_appointments_elder_id_elders_id_fk": {
|
|
"name": "family_visit_appointments_elder_id_elders_id_fk",
|
|
"tableFrom": "family_visit_appointments",
|
|
"tableTo": "elders",
|
|
"columnsFrom": [
|
|
"elder_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"family_visit_appointments_contact_id_family_contacts_id_fk": {
|
|
"name": "family_visit_appointments_contact_id_family_contacts_id_fk",
|
|
"tableFrom": "family_visit_appointments",
|
|
"tableTo": "family_contacts",
|
|
"columnsFrom": [
|
|
"contact_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"family_visit_appointments_handled_by_account_id_accounts_id_fk": {
|
|
"name": "family_visit_appointments_handled_by_account_id_accounts_id_fk",
|
|
"tableFrom": "family_visit_appointments",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"handled_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.floors": {
|
|
"name": "floors",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"building_id": {
|
|
"name": "building_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"level": {
|
|
"name": "level",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"floors_organization_id_organizations_id_fk": {
|
|
"name": "floors_organization_id_organizations_id_fk",
|
|
"tableFrom": "floors",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"floors_building_id_buildings_id_fk": {
|
|
"name": "floors_building_id_buildings_id_fk",
|
|
"tableFrom": "floors",
|
|
"tableTo": "buildings",
|
|
"columnsFrom": [
|
|
"building_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.health_anomaly_reviews": {
|
|
"name": "health_anomaly_reviews",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"elder_id": {
|
|
"name": "elder_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"vital_record_id": {
|
|
"name": "vital_record_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"severity": {
|
|
"name": "severity",
|
|
"type": "incident_severity",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "health_review_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'pending'"
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"reviewed_by_account_id": {
|
|
"name": "reviewed_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"reviewed_at": {
|
|
"name": "reviewed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"resolution_notes": {
|
|
"name": "resolution_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"health_anomaly_reviews_queue_lookup": {
|
|
"name": "health_anomaly_reviews_queue_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "severity",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"health_anomaly_reviews_organization_id_organizations_id_fk": {
|
|
"name": "health_anomaly_reviews_organization_id_organizations_id_fk",
|
|
"tableFrom": "health_anomaly_reviews",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"health_anomaly_reviews_elder_id_elders_id_fk": {
|
|
"name": "health_anomaly_reviews_elder_id_elders_id_fk",
|
|
"tableFrom": "health_anomaly_reviews",
|
|
"tableTo": "elders",
|
|
"columnsFrom": [
|
|
"elder_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"health_anomaly_reviews_vital_record_id_vital_records_id_fk": {
|
|
"name": "health_anomaly_reviews_vital_record_id_vital_records_id_fk",
|
|
"tableFrom": "health_anomaly_reviews",
|
|
"tableTo": "vital_records",
|
|
"columnsFrom": [
|
|
"vital_record_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"health_anomaly_reviews_reviewed_by_account_id_accounts_id_fk": {
|
|
"name": "health_anomaly_reviews_reviewed_by_account_id_accounts_id_fk",
|
|
"tableFrom": "health_anomaly_reviews",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"reviewed_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.health_profiles": {
|
|
"name": "health_profiles",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"elder_id": {
|
|
"name": "elder_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"allergy_notes": {
|
|
"name": "allergy_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"medical_history": {
|
|
"name": "medical_history",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"medication_notes": {
|
|
"name": "medication_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"care_restrictions": {
|
|
"name": "care_restrictions",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"emergency_notes": {
|
|
"name": "emergency_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"health_profiles_organization_elder_unique": {
|
|
"name": "health_profiles_organization_elder_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "elder_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"health_profiles_organization_id_organizations_id_fk": {
|
|
"name": "health_profiles_organization_id_organizations_id_fk",
|
|
"tableFrom": "health_profiles",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"health_profiles_elder_id_elders_id_fk": {
|
|
"name": "health_profiles_elder_id_elders_id_fk",
|
|
"tableFrom": "health_profiles",
|
|
"tableTo": "elders",
|
|
"columnsFrom": [
|
|
"elder_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.join_requests": {
|
|
"name": "join_requests",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"account_id": {
|
|
"name": "account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "join_request_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'pending'"
|
|
},
|
|
"reason": {
|
|
"name": "reason",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"reviewed_by_account_id": {
|
|
"name": "reviewed_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"reviewed_at": {
|
|
"name": "reviewed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"join_requests_account_id_accounts_id_fk": {
|
|
"name": "join_requests_account_id_accounts_id_fk",
|
|
"tableFrom": "join_requests",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"join_requests_organization_id_organizations_id_fk": {
|
|
"name": "join_requests_organization_id_organizations_id_fk",
|
|
"tableFrom": "join_requests",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"join_requests_reviewed_by_account_id_accounts_id_fk": {
|
|
"name": "join_requests_reviewed_by_account_id_accounts_id_fk",
|
|
"tableFrom": "join_requests",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"reviewed_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.maintenance_tickets": {
|
|
"name": "maintenance_tickets",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"device_id": {
|
|
"name": "device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"priority": {
|
|
"name": "priority",
|
|
"type": "maintenance_ticket_priority",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'normal'"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "maintenance_ticket_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'open'"
|
|
},
|
|
"assignee_label": {
|
|
"name": "assignee_label",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"resolution_notes": {
|
|
"name": "resolution_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"resolved_at": {
|
|
"name": "resolved_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"maintenance_tickets_queue_lookup": {
|
|
"name": "maintenance_tickets_queue_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "priority",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"maintenance_tickets_device_lookup": {
|
|
"name": "maintenance_tickets_device_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "device_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"maintenance_tickets_organization_id_organizations_id_fk": {
|
|
"name": "maintenance_tickets_organization_id_organizations_id_fk",
|
|
"tableFrom": "maintenance_tickets",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"maintenance_tickets_device_id_device_assets_id_fk": {
|
|
"name": "maintenance_tickets_device_id_device_assets_id_fk",
|
|
"tableFrom": "maintenance_tickets",
|
|
"tableTo": "device_assets",
|
|
"columnsFrom": [
|
|
"device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.memberships": {
|
|
"name": "memberships",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"account_id": {
|
|
"name": "account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"role_id": {
|
|
"name": "role_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "membership_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'active'"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"memberships_account_organization_unique": {
|
|
"name": "memberships_account_organization_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "account_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"memberships_account_id_accounts_id_fk": {
|
|
"name": "memberships_account_id_accounts_id_fk",
|
|
"tableFrom": "memberships",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"memberships_organization_id_organizations_id_fk": {
|
|
"name": "memberships_organization_id_organizations_id_fk",
|
|
"tableFrom": "memberships",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"memberships_role_id_roles_id_fk": {
|
|
"name": "memberships_role_id_roles_id_fk",
|
|
"tableFrom": "memberships",
|
|
"tableTo": "roles",
|
|
"columnsFrom": [
|
|
"role_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.notice_read_receipts": {
|
|
"name": "notice_read_receipts",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"notice_id": {
|
|
"name": "notice_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"account_id": {
|
|
"name": "account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"read_at": {
|
|
"name": "read_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"notice_read_receipts_account_notice_unique": {
|
|
"name": "notice_read_receipts_account_notice_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "notice_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "account_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"notice_read_receipts_notice_lookup": {
|
|
"name": "notice_read_receipts_notice_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "notice_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"notice_read_receipts_organization_id_organizations_id_fk": {
|
|
"name": "notice_read_receipts_organization_id_organizations_id_fk",
|
|
"tableFrom": "notice_read_receipts",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"notice_read_receipts_notice_id_notices_id_fk": {
|
|
"name": "notice_read_receipts_notice_id_notices_id_fk",
|
|
"tableFrom": "notice_read_receipts",
|
|
"tableTo": "notices",
|
|
"columnsFrom": [
|
|
"notice_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"notice_read_receipts_account_id_accounts_id_fk": {
|
|
"name": "notice_read_receipts_account_id_accounts_id_fk",
|
|
"tableFrom": "notice_read_receipts",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.notices": {
|
|
"name": "notices",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"content": {
|
|
"name": "content",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"audience": {
|
|
"name": "audience",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'全体员工'"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "notice_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'draft'"
|
|
},
|
|
"published_at": {
|
|
"name": "published_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_by_account_id": {
|
|
"name": "created_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"updated_by_account_id": {
|
|
"name": "updated_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"notices_status_lookup": {
|
|
"name": "notices_status_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"notices_organization_id_organizations_id_fk": {
|
|
"name": "notices_organization_id_organizations_id_fk",
|
|
"tableFrom": "notices",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"notices_created_by_account_id_accounts_id_fk": {
|
|
"name": "notices_created_by_account_id_accounts_id_fk",
|
|
"tableFrom": "notices",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"created_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"notices_updated_by_account_id_accounts_id_fk": {
|
|
"name": "notices_updated_by_account_id_accounts_id_fk",
|
|
"tableFrom": "notices",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"updated_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.organization_invitations": {
|
|
"name": "organization_invitations",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"role_id": {
|
|
"name": "role_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"token": {
|
|
"name": "token",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'active'"
|
|
},
|
|
"created_by_account_id": {
|
|
"name": "created_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"accepted_by_account_id": {
|
|
"name": "accepted_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"accepted_at": {
|
|
"name": "accepted_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"organization_invitations_token_unique": {
|
|
"name": "organization_invitations_token_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "token",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"organization_invitations_organization_id_organizations_id_fk": {
|
|
"name": "organization_invitations_organization_id_organizations_id_fk",
|
|
"tableFrom": "organization_invitations",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"organization_invitations_role_id_roles_id_fk": {
|
|
"name": "organization_invitations_role_id_roles_id_fk",
|
|
"tableFrom": "organization_invitations",
|
|
"tableTo": "roles",
|
|
"columnsFrom": [
|
|
"role_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"organization_invitations_created_by_account_id_accounts_id_fk": {
|
|
"name": "organization_invitations_created_by_account_id_accounts_id_fk",
|
|
"tableFrom": "organization_invitations",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"created_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"organization_invitations_accepted_by_account_id_accounts_id_fk": {
|
|
"name": "organization_invitations_accepted_by_account_id_accounts_id_fk",
|
|
"tableFrom": "organization_invitations",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"accepted_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.organizations": {
|
|
"name": "organizations",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"slug": {
|
|
"name": "slug",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "organization_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'active'"
|
|
},
|
|
"registration_enabled": {
|
|
"name": "registration_enabled",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"oidc_enabled": {
|
|
"name": "oidc_enabled",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"oidc_issuer_url": {
|
|
"name": "oidc_issuer_url",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"oidc_client_id": {
|
|
"name": "oidc_client_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"oidc_client_secret": {
|
|
"name": "oidc_client_secret",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"oidc_scopes": {
|
|
"name": "oidc_scopes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'openid profile email'"
|
|
},
|
|
"oidc_redirect_uri": {
|
|
"name": "oidc_redirect_uri",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"oidc_avatar_claim": {
|
|
"name": "oidc_avatar_claim",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'picture'"
|
|
},
|
|
"oidc_auto_provision": {
|
|
"name": "oidc_auto_provision",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"organizations_slug_unique": {
|
|
"name": "organizations_slug_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "slug",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.permissions": {
|
|
"name": "permissions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"label": {
|
|
"name": "label",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"category": {
|
|
"name": "category",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"is_enabled": {
|
|
"name": "is_enabled",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.role_permissions": {
|
|
"name": "role_permissions",
|
|
"schema": "",
|
|
"columns": {
|
|
"role_id": {
|
|
"name": "role_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"permission_id": {
|
|
"name": "permission_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"role_permissions_role_id_roles_id_fk": {
|
|
"name": "role_permissions_role_id_roles_id_fk",
|
|
"tableFrom": "role_permissions",
|
|
"tableTo": "roles",
|
|
"columnsFrom": [
|
|
"role_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"role_permissions_permission_id_permissions_id_fk": {
|
|
"name": "role_permissions_permission_id_permissions_id_fk",
|
|
"tableFrom": "role_permissions",
|
|
"tableTo": "permissions",
|
|
"columnsFrom": [
|
|
"permission_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"role_permissions_role_id_permission_id_pk": {
|
|
"name": "role_permissions_role_id_permission_id_pk",
|
|
"columns": [
|
|
"role_id",
|
|
"permission_id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.roles": {
|
|
"name": "roles",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"key": {
|
|
"name": "key",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"scope": {
|
|
"name": "scope",
|
|
"type": "role_scope",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"label": {
|
|
"name": "label",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"is_system": {
|
|
"name": "is_system",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"is_enabled": {
|
|
"name": "is_enabled",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"roles_key_organization_unique": {
|
|
"name": "roles_key_organization_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "key",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"roles_organization_id_organizations_id_fk": {
|
|
"name": "roles_organization_id_organizations_id_fk",
|
|
"tableFrom": "roles",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.rooms": {
|
|
"name": "rooms",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"floor_id": {
|
|
"name": "floor_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"code": {
|
|
"name": "code",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"capacity": {
|
|
"name": "capacity",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 1
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "organization_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'active'"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"rooms_code_organization_unique": {
|
|
"name": "rooms_code_organization_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "code",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"rooms_organization_id_organizations_id_fk": {
|
|
"name": "rooms_organization_id_organizations_id_fk",
|
|
"tableFrom": "rooms",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_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": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.sessions": {
|
|
"name": "sessions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"account_id": {
|
|
"name": "account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"active_organization_id": {
|
|
"name": "active_organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"sessions_account_id_accounts_id_fk": {
|
|
"name": "sessions_account_id_accounts_id_fk",
|
|
"tableFrom": "sessions",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"sessions_active_organization_id_organizations_id_fk": {
|
|
"name": "sessions_active_organization_id_organizations_id_fk",
|
|
"tableFrom": "sessions",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"active_organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.system_incidents": {
|
|
"name": "system_incidents",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"severity": {
|
|
"name": "severity",
|
|
"type": "incident_severity",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "incident_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'open'"
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"source": {
|
|
"name": "source",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"acknowledged_by_account_id": {
|
|
"name": "acknowledged_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"acknowledged_at": {
|
|
"name": "acknowledged_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"resolved_by_account_id": {
|
|
"name": "resolved_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"resolved_at": {
|
|
"name": "resolved_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"system_incidents_organization_id_organizations_id_fk": {
|
|
"name": "system_incidents_organization_id_organizations_id_fk",
|
|
"tableFrom": "system_incidents",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"system_incidents_acknowledged_by_account_id_accounts_id_fk": {
|
|
"name": "system_incidents_acknowledged_by_account_id_accounts_id_fk",
|
|
"tableFrom": "system_incidents",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"acknowledged_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"system_incidents_resolved_by_account_id_accounts_id_fk": {
|
|
"name": "system_incidents_resolved_by_account_id_accounts_id_fk",
|
|
"tableFrom": "system_incidents",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"resolved_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.system_settings": {
|
|
"name": "system_settings",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "'global'"
|
|
},
|
|
"registration_enabled": {
|
|
"name": "registration_enabled",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"oidc_enabled": {
|
|
"name": "oidc_enabled",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"oidc_issuer_url": {
|
|
"name": "oidc_issuer_url",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"oidc_client_id": {
|
|
"name": "oidc_client_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"oidc_client_secret": {
|
|
"name": "oidc_client_secret",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"oidc_scopes": {
|
|
"name": "oidc_scopes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'openid profile email'"
|
|
},
|
|
"oidc_redirect_uri": {
|
|
"name": "oidc_redirect_uri",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"oidc_avatar_claim": {
|
|
"name": "oidc_avatar_claim",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'picture'"
|
|
},
|
|
"oidc_auto_provision": {
|
|
"name": "oidc_auto_provision",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.vital_records": {
|
|
"name": "vital_records",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"organization_id": {
|
|
"name": "organization_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"elder_id": {
|
|
"name": "elder_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"recorded_at": {
|
|
"name": "recorded_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"source": {
|
|
"name": "source",
|
|
"type": "vital_record_source",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'manual'"
|
|
},
|
|
"systolic_bp": {
|
|
"name": "systolic_bp",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"diastolic_bp": {
|
|
"name": "diastolic_bp",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"heart_rate": {
|
|
"name": "heart_rate",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"temperature_tenths": {
|
|
"name": "temperature_tenths",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"spo2": {
|
|
"name": "spo2",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"blood_glucose_tenths": {
|
|
"name": "blood_glucose_tenths",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"weight_tenths": {
|
|
"name": "weight_tenths",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"notes": {
|
|
"name": "notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"created_by_account_id": {
|
|
"name": "created_by_account_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"vital_records_recent_lookup": {
|
|
"name": "vital_records_recent_lookup",
|
|
"columns": [
|
|
{
|
|
"expression": "organization_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "elder_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "recorded_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"vital_records_organization_id_organizations_id_fk": {
|
|
"name": "vital_records_organization_id_organizations_id_fk",
|
|
"tableFrom": "vital_records",
|
|
"tableTo": "organizations",
|
|
"columnsFrom": [
|
|
"organization_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"vital_records_elder_id_elders_id_fk": {
|
|
"name": "vital_records_elder_id_elders_id_fk",
|
|
"tableFrom": "vital_records",
|
|
"tableTo": "elders",
|
|
"columnsFrom": [
|
|
"elder_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"vital_records_created_by_account_id_accounts_id_fk": {
|
|
"name": "vital_records_created_by_account_id_accounts_id_fk",
|
|
"tableFrom": "vital_records",
|
|
"tableTo": "accounts",
|
|
"columnsFrom": [
|
|
"created_by_account_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
}
|
|
},
|
|
"enums": {
|
|
"public.account_status": {
|
|
"name": "account_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"active",
|
|
"disabled",
|
|
"pending"
|
|
]
|
|
},
|
|
"public.admission_status": {
|
|
"name": "admission_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"active",
|
|
"transferred",
|
|
"discharged"
|
|
]
|
|
},
|
|
"public.alert_rule_status": {
|
|
"name": "alert_rule_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"enabled",
|
|
"disabled"
|
|
]
|
|
},
|
|
"public.alert_rule_type": {
|
|
"name": "alert_rule_type",
|
|
"schema": "public",
|
|
"values": [
|
|
"health",
|
|
"care",
|
|
"device",
|
|
"incident",
|
|
"admission",
|
|
"other"
|
|
]
|
|
},
|
|
"public.alert_trigger_status": {
|
|
"name": "alert_trigger_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"open",
|
|
"acknowledged",
|
|
"resolved",
|
|
"closed"
|
|
]
|
|
},
|
|
"public.audit_result": {
|
|
"name": "audit_result",
|
|
"schema": "public",
|
|
"values": [
|
|
"success",
|
|
"denied",
|
|
"failure"
|
|
]
|
|
},
|
|
"public.bed_status": {
|
|
"name": "bed_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"available",
|
|
"occupied",
|
|
"maintenance",
|
|
"disabled"
|
|
]
|
|
},
|
|
"public.care_level": {
|
|
"name": "care_level",
|
|
"schema": "public",
|
|
"values": [
|
|
"self-care",
|
|
"semi-assisted",
|
|
"assisted",
|
|
"intensive"
|
|
]
|
|
},
|
|
"public.care_task_priority": {
|
|
"name": "care_task_priority",
|
|
"schema": "public",
|
|
"values": [
|
|
"low",
|
|
"normal",
|
|
"high",
|
|
"urgent"
|
|
]
|
|
},
|
|
"public.care_task_status": {
|
|
"name": "care_task_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"pending",
|
|
"in_progress",
|
|
"completed",
|
|
"cancelled"
|
|
]
|
|
},
|
|
"public.care_task_type": {
|
|
"name": "care_task_type",
|
|
"schema": "public",
|
|
"values": [
|
|
"daily_care",
|
|
"meal",
|
|
"medication",
|
|
"rehab",
|
|
"inspection",
|
|
"cleaning",
|
|
"other"
|
|
]
|
|
},
|
|
"public.chronic_condition_status": {
|
|
"name": "chronic_condition_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"active",
|
|
"controlled",
|
|
"resolved"
|
|
]
|
|
},
|
|
"public.device_asset_status": {
|
|
"name": "device_asset_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"active",
|
|
"maintenance",
|
|
"disabled",
|
|
"retired"
|
|
]
|
|
},
|
|
"public.elder_status": {
|
|
"name": "elder_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"active",
|
|
"pending",
|
|
"discharged"
|
|
]
|
|
},
|
|
"public.family_contact_status": {
|
|
"name": "family_contact_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"active",
|
|
"suspended",
|
|
"archived"
|
|
]
|
|
},
|
|
"public.family_feedback_status": {
|
|
"name": "family_feedback_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"open",
|
|
"in_progress",
|
|
"resolved",
|
|
"closed"
|
|
]
|
|
},
|
|
"public.family_feedback_type": {
|
|
"name": "family_feedback_type",
|
|
"schema": "public",
|
|
"values": [
|
|
"service",
|
|
"care",
|
|
"meal",
|
|
"environment",
|
|
"other"
|
|
]
|
|
},
|
|
"public.family_visit_status": {
|
|
"name": "family_visit_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"requested",
|
|
"approved",
|
|
"completed",
|
|
"cancelled"
|
|
]
|
|
},
|
|
"public.gender": {
|
|
"name": "gender",
|
|
"schema": "public",
|
|
"values": [
|
|
"male",
|
|
"female",
|
|
"other"
|
|
]
|
|
},
|
|
"public.health_review_status": {
|
|
"name": "health_review_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"pending",
|
|
"reviewed",
|
|
"resolved"
|
|
]
|
|
},
|
|
"public.incident_severity": {
|
|
"name": "incident_severity",
|
|
"schema": "public",
|
|
"values": [
|
|
"info",
|
|
"warning",
|
|
"critical"
|
|
]
|
|
},
|
|
"public.incident_status": {
|
|
"name": "incident_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"open",
|
|
"acknowledged",
|
|
"resolved",
|
|
"closed"
|
|
]
|
|
},
|
|
"public.join_request_status": {
|
|
"name": "join_request_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"pending",
|
|
"approved",
|
|
"rejected"
|
|
]
|
|
},
|
|
"public.maintenance_ticket_priority": {
|
|
"name": "maintenance_ticket_priority",
|
|
"schema": "public",
|
|
"values": [
|
|
"low",
|
|
"normal",
|
|
"high",
|
|
"urgent"
|
|
]
|
|
},
|
|
"public.maintenance_ticket_status": {
|
|
"name": "maintenance_ticket_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"open",
|
|
"assigned",
|
|
"resolved",
|
|
"closed",
|
|
"cancelled"
|
|
]
|
|
},
|
|
"public.membership_status": {
|
|
"name": "membership_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"active",
|
|
"disabled",
|
|
"pending"
|
|
]
|
|
},
|
|
"public.notice_status": {
|
|
"name": "notice_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"draft",
|
|
"published",
|
|
"retracted"
|
|
]
|
|
},
|
|
"public.organization_status": {
|
|
"name": "organization_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"active",
|
|
"disabled"
|
|
]
|
|
},
|
|
"public.role_scope": {
|
|
"name": "role_scope",
|
|
"schema": "public",
|
|
"values": [
|
|
"platform",
|
|
"organization"
|
|
]
|
|
},
|
|
"public.vital_record_source": {
|
|
"name": "vital_record_source",
|
|
"schema": "public",
|
|
"values": [
|
|
"manual",
|
|
"device",
|
|
"import"
|
|
]
|
|
}
|
|
},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
} |