{ "id": "6e786663-8ca4-4a3a-bc06-a0e7adbd9408", "prevId": "0c2bcebb-972f-40e7-8f42-767236bd63ce", "version": "7", "dialect": "postgresql", "tables": { "public.account": { "name": "account", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "account_id": { "name": "account_id", "type": "text", "primaryKey": false, "notNull": true }, "provider_id": { "name": "provider_id", "type": "text", "primaryKey": false, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true }, "access_token": { "name": "access_token", "type": "text", "primaryKey": false, "notNull": false }, "refresh_token": { "name": "refresh_token", "type": "text", "primaryKey": false, "notNull": false }, "id_token": { "name": "id_token", "type": "text", "primaryKey": false, "notNull": false }, "access_token_expires_at": { "name": "access_token_expires_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "refresh_token_expires_at": { "name": "refresh_token_expires_at", "type": "timestamp", "primaryKey": false, "notNull": false }, "scope": { "name": "scope", "type": "text", "primaryKey": false, "notNull": false }, "password": { "name": "password", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": true } }, "indexes": { "account_userId_idx": { "name": "account_userId_idx", "columns": [ { "expression": "user_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "account_user_id_user_id_fk": { "name": "account_user_id_user_id_fk", "tableFrom": "account", "tableTo": "user", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.invitation": { "name": "invitation", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "organization_id": { "name": "organization_id", "type": "text", "primaryKey": false, "notNull": true }, "email": { "name": "email", "type": "text", "primaryKey": false, "notNull": true }, "role": { "name": "role", "type": "text", "primaryKey": false, "notNull": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "default": "'pending'" }, "expires_at": { "name": "expires_at", "type": "timestamp", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "inviter_id": { "name": "inviter_id", "type": "text", "primaryKey": false, "notNull": true } }, "indexes": { "invitation_organizationId_idx": { "name": "invitation_organizationId_idx", "columns": [ { "expression": "organization_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} }, "invitation_email_idx": { "name": "invitation_email_idx", "columns": [ { "expression": "email", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "invitation_organization_id_organization_id_fk": { "name": "invitation_organization_id_organization_id_fk", "tableFrom": "invitation", "tableTo": "organization", "columnsFrom": [ "organization_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "invitation_inviter_id_user_id_fk": { "name": "invitation_inviter_id_user_id_fk", "tableFrom": "invitation", "tableTo": "user", "columnsFrom": [ "inviter_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.member": { "name": "member", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "organization_id": { "name": "organization_id", "type": "text", "primaryKey": false, "notNull": true }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true }, "role": { "name": "role", "type": "text", "primaryKey": false, "notNull": true, "default": "'member'" }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true } }, "indexes": { "member_organizationId_idx": { "name": "member_organizationId_idx", "columns": [ { "expression": "organization_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} }, "member_userId_idx": { "name": "member_userId_idx", "columns": [ { "expression": "user_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "member_organization_id_organization_id_fk": { "name": "member_organization_id_organization_id_fk", "tableFrom": "member", "tableTo": "organization", "columnsFrom": [ "organization_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "member_user_id_user_id_fk": { "name": "member_user_id_user_id_fk", "tableFrom": "member", "tableTo": "user", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.organization": { "name": "organization", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "slug": { "name": "slug", "type": "text", "primaryKey": false, "notNull": true }, "logo": { "name": "logo", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true }, "metadata": { "name": "metadata", "type": "text", "primaryKey": false, "notNull": false } }, "indexes": { "organization_slug_uidx": { "name": "organization_slug_uidx", "columns": [ { "expression": "slug", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": true, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "organization_slug_unique": { "name": "organization_slug_unique", "nullsNotDistinct": false, "columns": [ "slug" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.rate_limit": { "name": "rate_limit", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "key": { "name": "key", "type": "text", "primaryKey": false, "notNull": true }, "count": { "name": "count", "type": "integer", "primaryKey": false, "notNull": true }, "last_request": { "name": "last_request", "type": "bigint", "primaryKey": false, "notNull": true } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "rate_limit_key_unique": { "name": "rate_limit_key_unique", "nullsNotDistinct": false, "columns": [ "key" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.session": { "name": "session", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "expires_at": { "name": "expires_at", "type": "timestamp", "primaryKey": false, "notNull": true }, "token": { "name": "token", "type": "text", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": true }, "ip_address": { "name": "ip_address", "type": "text", "primaryKey": false, "notNull": false }, "user_agent": { "name": "user_agent", "type": "text", "primaryKey": false, "notNull": false }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, "notNull": true }, "active_organization_id": { "name": "active_organization_id", "type": "text", "primaryKey": false, "notNull": false } }, "indexes": { "session_userId_idx": { "name": "session_userId_idx", "columns": [ { "expression": "user_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "session_user_id_user_id_fk": { "name": "session_user_id_user_id_fk", "tableFrom": "session", "tableTo": "user", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "session_token_unique": { "name": "session_token_unique", "nullsNotDistinct": false, "columns": [ "token" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.user": { "name": "user", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "email": { "name": "email", "type": "text", "primaryKey": false, "notNull": true }, "email_verified": { "name": "email_verified", "type": "boolean", "primaryKey": false, "notNull": true, "default": false }, "image": { "name": "image", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { "user_email_unique": { "name": "user_email_unique", "nullsNotDistinct": false, "columns": [ "email" ] } }, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.verification": { "name": "verification", "schema": "", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true }, "identifier": { "name": "identifier", "type": "text", "primaryKey": false, "notNull": true }, "value": { "name": "value", "type": "text", "primaryKey": false, "notNull": true }, "expires_at": { "name": "expires_at", "type": "timestamp", "primaryKey": false, "notNull": true }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "verification_identifier_idx": { "name": "verification_identifier_idx", "columns": [ { "expression": "identifier", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.patient_allergies": { "name": "patient_allergies", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "patient_id": { "name": "patient_id", "type": "uuid", "primaryKey": false, "notNull": true }, "position": { "name": "position", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "substance": { "name": "substance", "type": "text", "primaryKey": false, "notNull": true }, "reaction": { "name": "reaction", "type": "text", "primaryKey": false, "notNull": true }, "severity": { "name": "severity", "type": "text", "primaryKey": false, "notNull": true } }, "indexes": { "allergies_patient_idx": { "name": "allergies_patient_idx", "columns": [ { "expression": "patient_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "patient_allergies_patient_id_patients_id_fk": { "name": "patient_allergies_patient_id_patients_id_fk", "tableFrom": "patient_allergies", "tableTo": "patients", "columnsFrom": [ "patient_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.patient_encounters": { "name": "patient_encounters", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "patient_id": { "name": "patient_id", "type": "uuid", "primaryKey": false, "notNull": true }, "position": { "name": "position", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "date": { "name": "date", "type": "text", "primaryKey": false, "notNull": true }, "type": { "name": "type", "type": "text", "primaryKey": false, "notNull": true }, "provider": { "name": "provider", "type": "text", "primaryKey": false, "notNull": true }, "summary": { "name": "summary", "type": "text", "primaryKey": false, "notNull": true } }, "indexes": { "encounters_patient_idx": { "name": "encounters_patient_idx", "columns": [ { "expression": "patient_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "patient_encounters_patient_id_patients_id_fk": { "name": "patient_encounters_patient_id_patients_id_fk", "tableFrom": "patient_encounters", "tableTo": "patients", "columnsFrom": [ "patient_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.patient_labs": { "name": "patient_labs", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "patient_id": { "name": "patient_id", "type": "uuid", "primaryKey": false, "notNull": true }, "position": { "name": "position", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "value": { "name": "value", "type": "text", "primaryKey": false, "notNull": true }, "flag": { "name": "flag", "type": "text", "primaryKey": false, "notNull": true }, "taken_at": { "name": "taken_at", "type": "text", "primaryKey": false, "notNull": true } }, "indexes": { "labs_patient_idx": { "name": "labs_patient_idx", "columns": [ { "expression": "patient_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "patient_labs_patient_id_patients_id_fk": { "name": "patient_labs_patient_id_patients_id_fk", "tableFrom": "patient_labs", "tableTo": "patients", "columnsFrom": [ "patient_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.patient_medications": { "name": "patient_medications", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "patient_id": { "name": "patient_id", "type": "uuid", "primaryKey": false, "notNull": true }, "position": { "name": "position", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "dose": { "name": "dose", "type": "text", "primaryKey": false, "notNull": true }, "frequency": { "name": "frequency", "type": "text", "primaryKey": false, "notNull": true } }, "indexes": { "medications_patient_idx": { "name": "medications_patient_idx", "columns": [ { "expression": "patient_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "patient_medications_patient_id_patients_id_fk": { "name": "patient_medications_patient_id_patients_id_fk", "tableFrom": "patient_medications", "tableTo": "patients", "columnsFrom": [ "patient_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.patients": { "name": "patients", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "organization_id": { "name": "organization_id", "type": "text", "primaryKey": false, "notNull": true }, "file_number": { "name": "file_number", "type": "text", "primaryKey": false, "notNull": true }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true }, "age": { "name": "age", "type": "integer", "primaryKey": false, "notNull": true }, "sex": { "name": "sex", "type": "text", "primaryKey": false, "notNull": true }, "pcp": { "name": "pcp", "type": "text", "primaryKey": false, "notNull": true }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true }, "initials": { "name": "initials", "type": "text", "primaryKey": false, "notNull": true }, "alerts": { "name": "alerts", "type": "jsonb", "primaryKey": false, "notNull": true }, "vitals_bp": { "name": "vitals_bp", "type": "text", "primaryKey": false, "notNull": true }, "vitals_hr": { "name": "vitals_hr", "type": "text", "primaryKey": false, "notNull": true }, "vitals_temp": { "name": "vitals_temp", "type": "text", "primaryKey": false, "notNull": true }, "vitals_spo2": { "name": "vitals_spo2", "type": "text", "primaryKey": false, "notNull": true }, "vitals_taken_at": { "name": "vitals_taken_at", "type": "text", "primaryKey": false, "notNull": true }, "vitals_trend": { "name": "vitals_trend", "type": "jsonb", "primaryKey": false, "notNull": true }, "lab_trend": { "name": "lab_trend", "type": "jsonb", "primaryKey": false, "notNull": true }, "created_by": { "name": "created_by", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "patients_org_file_uidx": { "name": "patients_org_file_uidx", "columns": [ { "expression": "organization_id", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "file_number", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": true, "concurrently": false, "method": "btree", "with": {} }, "patients_org_idx": { "name": "patients_org_idx", "columns": [ { "expression": "organization_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "patients_organization_id_organization_id_fk": { "name": "patients_organization_id_organization_id_fk", "tableFrom": "patients", "tableTo": "organization", "columnsFrom": [ "organization_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "patients_created_by_user_id_fk": { "name": "patients_created_by_user_id_fk", "tableFrom": "patients", "tableTo": "user", "columnsFrom": [ "created_by" ], "columnsTo": [ "id" ], "onDelete": "set null", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.patient_problems": { "name": "patient_problems", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "patient_id": { "name": "patient_id", "type": "uuid", "primaryKey": false, "notNull": true }, "position": { "name": "position", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "label": { "name": "label", "type": "text", "primaryKey": false, "notNull": true }, "since": { "name": "since", "type": "text", "primaryKey": false, "notNull": true } }, "indexes": { "problems_patient_idx": { "name": "problems_patient_idx", "columns": [ { "expression": "patient_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "patient_problems_patient_id_patients_id_fk": { "name": "patient_problems_patient_id_patients_id_fk", "tableFrom": "patient_problems", "tableTo": "patients", "columnsFrom": [ "patient_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.notes": { "name": "notes", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "organization_id": { "name": "organization_id", "type": "text", "primaryKey": false, "notNull": true }, "author_id": { "name": "author_id", "type": "text", "primaryKey": false, "notNull": true }, "title": { "name": "title", "type": "text", "primaryKey": false, "notNull": true }, "content": { "name": "content", "type": "text", "primaryKey": false, "notNull": true, "default": "''" }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "notes_org_author_idx": { "name": "notes_org_author_idx", "columns": [ { "expression": "organization_id", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "author_id", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "notes_organization_id_organization_id_fk": { "name": "notes_organization_id_organization_id_fk", "tableFrom": "notes", "tableTo": "organization", "columnsFrom": [ "organization_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "notes_author_id_user_id_fk": { "name": "notes_author_id_user_id_fk", "tableFrom": "notes", "tableTo": "user", "columnsFrom": [ "author_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.appointments": { "name": "appointments", "schema": "", "columns": { "id": { "name": "id", "type": "uuid", "primaryKey": true, "notNull": true, "default": "gen_random_uuid()" }, "organization_id": { "name": "organization_id", "type": "text", "primaryKey": false, "notNull": true }, "patient_file_number": { "name": "patient_file_number", "type": "text", "primaryKey": false, "notNull": true, "default": "''" }, "patient_name": { "name": "patient_name", "type": "text", "primaryKey": false, "notNull": true }, "patient_initials": { "name": "patient_initials", "type": "text", "primaryKey": false, "notNull": true }, "date": { "name": "date", "type": "text", "primaryKey": false, "notNull": true }, "time": { "name": "time", "type": "text", "primaryKey": false, "notNull": true }, "type": { "name": "type", "type": "text", "primaryKey": false, "notNull": true }, "provider": { "name": "provider", "type": "text", "primaryKey": false, "notNull": true }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true }, "created_by": { "name": "created_by", "type": "text", "primaryKey": false, "notNull": false }, "created_at": { "name": "created_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" }, "updated_at": { "name": "updated_at", "type": "timestamp", "primaryKey": false, "notNull": true, "default": "now()" } }, "indexes": { "appointments_org_date_idx": { "name": "appointments_org_date_idx", "columns": [ { "expression": "organization_id", "isExpression": false, "asc": true, "nulls": "last" }, { "expression": "date", "isExpression": false, "asc": true, "nulls": "last" } ], "isUnique": false, "concurrently": false, "method": "btree", "with": {} } }, "foreignKeys": { "appointments_organization_id_organization_id_fk": { "name": "appointments_organization_id_organization_id_fk", "tableFrom": "appointments", "tableTo": "organization", "columnsFrom": [ "organization_id" ], "columnsTo": [ "id" ], "onDelete": "cascade", "onUpdate": "no action" }, "appointments_created_by_user_id_fk": { "name": "appointments_created_by_user_id_fk", "tableFrom": "appointments", "tableTo": "user", "columnsFrom": [ "created_by" ], "columnsTo": [ "id" ], "onDelete": "set null", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false } }, "enums": {}, "schemas": {}, "sequences": {}, "roles": {}, "policies": {}, "views": {}, "_meta": { "columns": {}, "schemas": {}, "tables": {} } }