1581 lines
41 KiB
JSON
1581 lines
41 KiB
JSON
{
|
|
"id": "0d7c9ca5-3435-470e-8da1-96e3f4e42e1c",
|
|
"prevId": "c3abbb33-47fc-4214-9249-25f0a37793cc",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"public.account": {
|
|
"name": "account",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"account_id": {
|
|
"name": "account_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"provider_id": {
|
|
"name": "provider_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
|
|
},
|
|
"access_token_expires_at": {
|
|
"name": "access_token_expires_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"refresh_token_expires_at": {
|
|
"name": "refresh_token_expires_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"id_token": {
|
|
"name": "id_token",
|
|
"type": "text",
|
|
"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 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": {
|
|
"account_user_id_users_id_fk": {
|
|
"name": "account_user_id_users_id_fk",
|
|
"tableFrom": "account",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_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()"
|
|
},
|
|
"owner_user_id": {
|
|
"name": "owner_user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"actor_device_id": {
|
|
"name": "actor_device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"action": {
|
|
"name": "action",
|
|
"type": "varchar(128)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"target_type": {
|
|
"name": "target_type",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"target_id": {
|
|
"name": "target_id",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"metadata": {
|
|
"name": "metadata",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'null'::jsonb"
|
|
},
|
|
"ip_address": {
|
|
"name": "ip_address",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"audit_logs_owner_user_id_users_id_fk": {
|
|
"name": "audit_logs_owner_user_id_users_id_fk",
|
|
"tableFrom": "audit_logs",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"owner_user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"audit_logs_actor_device_id_devices_id_fk": {
|
|
"name": "audit_logs_actor_device_id_devices_id_fk",
|
|
"tableFrom": "audit_logs",
|
|
"tableTo": "devices",
|
|
"columnsFrom": [
|
|
"actor_device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.device_commands": {
|
|
"name": "device_commands",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"owner_user_id": {
|
|
"name": "owner_user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"source_device_id": {
|
|
"name": "source_device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"target_device_id": {
|
|
"name": "target_device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"command_type": {
|
|
"name": "command_type",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"payload": {
|
|
"name": "payload",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'null'::jsonb"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'queued'"
|
|
},
|
|
"retry_count": {
|
|
"name": "retry_count",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"last_dispatched_at": {
|
|
"name": "last_dispatched_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"acknowledged_at": {
|
|
"name": "acknowledged_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"error": {
|
|
"name": "error",
|
|
"type": "text",
|
|
"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": {
|
|
"device_commands_owner_user_id_users_id_fk": {
|
|
"name": "device_commands_owner_user_id_users_id_fk",
|
|
"tableFrom": "device_commands",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"owner_user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"device_commands_source_device_id_devices_id_fk": {
|
|
"name": "device_commands_source_device_id_devices_id_fk",
|
|
"tableFrom": "device_commands",
|
|
"tableTo": "devices",
|
|
"columnsFrom": [
|
|
"source_device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"device_commands_target_device_id_devices_id_fk": {
|
|
"name": "device_commands_target_device_id_devices_id_fk",
|
|
"tableFrom": "device_commands",
|
|
"tableTo": "devices",
|
|
"columnsFrom": [
|
|
"target_device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.device_links": {
|
|
"name": "device_links",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"owner_user_id": {
|
|
"name": "owner_user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"camera_device_id": {
|
|
"name": "camera_device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"client_device_id": {
|
|
"name": "client_device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "varchar(32)",
|
|
"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": {},
|
|
"foreignKeys": {
|
|
"device_links_owner_user_id_users_id_fk": {
|
|
"name": "device_links_owner_user_id_users_id_fk",
|
|
"tableFrom": "device_links",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"owner_user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"device_links_camera_device_id_devices_id_fk": {
|
|
"name": "device_links_camera_device_id_devices_id_fk",
|
|
"tableFrom": "device_links",
|
|
"tableTo": "devices",
|
|
"columnsFrom": [
|
|
"camera_device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"device_links_client_device_id_devices_id_fk": {
|
|
"name": "device_links_client_device_id_devices_id_fk",
|
|
"tableFrom": "device_links",
|
|
"tableTo": "devices",
|
|
"columnsFrom": [
|
|
"client_device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"device_links_camera_client_unique": {
|
|
"name": "device_links_camera_client_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"camera_device_id",
|
|
"client_device_id"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.devices": {
|
|
"name": "devices",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"role": {
|
|
"name": "role",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'client'"
|
|
},
|
|
"platform": {
|
|
"name": "platform",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"app_version": {
|
|
"name": "app_version",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"push_token": {
|
|
"name": "push_token",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'offline'"
|
|
},
|
|
"is_camera": {
|
|
"name": "is_camera",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"last_seen_at": {
|
|
"name": "last_seen_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"devices_user_id_users_id_fk": {
|
|
"name": "devices_user_id_users_id_fk",
|
|
"tableFrom": "devices",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.events": {
|
|
"name": "events",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"device_id": {
|
|
"name": "device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"triggered_by": {
|
|
"name": "triggered_by",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'motion'"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'recording'"
|
|
},
|
|
"started_at": {
|
|
"name": "started_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"ended_at": {
|
|
"name": "ended_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"notified_at": {
|
|
"name": "notified_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"video_url": {
|
|
"name": "video_url",
|
|
"type": "varchar(1024)",
|
|
"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": {
|
|
"events_user_id_users_id_fk": {
|
|
"name": "events_user_id_users_id_fk",
|
|
"tableFrom": "events",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"events_device_id_devices_id_fk": {
|
|
"name": "events_device_id_devices_id_fk",
|
|
"tableFrom": "events",
|
|
"tableTo": "devices",
|
|
"columnsFrom": [
|
|
"device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"events_video_url_unique": {
|
|
"name": "events_video_url_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"video_url"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.notifications": {
|
|
"name": "notifications",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"event_id": {
|
|
"name": "event_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"sent_at": {
|
|
"name": "sent_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"channel": {
|
|
"name": "channel",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'queued'"
|
|
},
|
|
"is_read": {
|
|
"name": "is_read",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"notifications_event_id_events_id_fk": {
|
|
"name": "notifications_event_id_events_id_fk",
|
|
"tableFrom": "notifications",
|
|
"tableTo": "events",
|
|
"columnsFrom": [
|
|
"event_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"notifications_user_id_users_id_fk": {
|
|
"name": "notifications_user_id_users_id_fk",
|
|
"tableFrom": "notifications",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.push_notifications": {
|
|
"name": "push_notifications",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"owner_user_id": {
|
|
"name": "owner_user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"recipient_device_id": {
|
|
"name": "recipient_device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"payload": {
|
|
"name": "payload",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'null'::jsonb"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'queued'"
|
|
},
|
|
"attempts": {
|
|
"name": "attempts",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"last_error": {
|
|
"name": "last_error",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"sent_at": {
|
|
"name": "sent_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"next_attempt_at": {
|
|
"name": "next_attempt_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"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": {
|
|
"push_notifications_owner_user_id_users_id_fk": {
|
|
"name": "push_notifications_owner_user_id_users_id_fk",
|
|
"tableFrom": "push_notifications",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"owner_user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"push_notifications_recipient_device_id_devices_id_fk": {
|
|
"name": "push_notifications_recipient_device_id_devices_id_fk",
|
|
"tableFrom": "push_notifications",
|
|
"tableTo": "devices",
|
|
"columnsFrom": [
|
|
"recipient_device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.recordings": {
|
|
"name": "recordings",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"owner_user_id": {
|
|
"name": "owner_user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"stream_session_id": {
|
|
"name": "stream_session_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"camera_device_id": {
|
|
"name": "camera_device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"requester_device_id": {
|
|
"name": "requester_device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"event_id": {
|
|
"name": "event_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"object_key": {
|
|
"name": "object_key",
|
|
"type": "varchar(1024)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"bucket": {
|
|
"name": "bucket",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"duration_seconds": {
|
|
"name": "duration_seconds",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"size_bytes": {
|
|
"name": "size_bytes",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'awaiting_upload'"
|
|
},
|
|
"available_at": {
|
|
"name": "available_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"error": {
|
|
"name": "error",
|
|
"type": "text",
|
|
"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": {
|
|
"recordings_owner_user_id_users_id_fk": {
|
|
"name": "recordings_owner_user_id_users_id_fk",
|
|
"tableFrom": "recordings",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"owner_user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"recordings_stream_session_id_stream_sessions_id_fk": {
|
|
"name": "recordings_stream_session_id_stream_sessions_id_fk",
|
|
"tableFrom": "recordings",
|
|
"tableTo": "stream_sessions",
|
|
"columnsFrom": [
|
|
"stream_session_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"recordings_camera_device_id_devices_id_fk": {
|
|
"name": "recordings_camera_device_id_devices_id_fk",
|
|
"tableFrom": "recordings",
|
|
"tableTo": "devices",
|
|
"columnsFrom": [
|
|
"camera_device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"recordings_requester_device_id_devices_id_fk": {
|
|
"name": "recordings_requester_device_id_devices_id_fk",
|
|
"tableFrom": "recordings",
|
|
"tableTo": "devices",
|
|
"columnsFrom": [
|
|
"requester_device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"recordings_event_id_events_id_fk": {
|
|
"name": "recordings_event_id_events_id_fk",
|
|
"tableFrom": "recordings",
|
|
"tableTo": "events",
|
|
"columnsFrom": [
|
|
"event_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.session": {
|
|
"name": "session",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"token": {
|
|
"name": "token",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp with time zone",
|
|
"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
|
|
},
|
|
"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": {
|
|
"session_user_id_users_id_fk": {
|
|
"name": "session_user_id_users_id_fk",
|
|
"tableFrom": "session",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"session_token_unique": {
|
|
"name": "session_token_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"token"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.stream_sessions": {
|
|
"name": "stream_sessions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"owner_user_id": {
|
|
"name": "owner_user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"camera_device_id": {
|
|
"name": "camera_device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"requester_device_id": {
|
|
"name": "requester_device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'requested'"
|
|
},
|
|
"reason": {
|
|
"name": "reason",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'on_demand'"
|
|
},
|
|
"media_provider": {
|
|
"name": "media_provider",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'mock'"
|
|
},
|
|
"media_session_id": {
|
|
"name": "media_session_id",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"publish_endpoint": {
|
|
"name": "publish_endpoint",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"subscribe_endpoint": {
|
|
"name": "subscribe_endpoint",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"stream_key": {
|
|
"name": "stream_key",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"started_at": {
|
|
"name": "started_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ended_at": {
|
|
"name": "ended_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"metadata": {
|
|
"name": "metadata",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "'null'::jsonb"
|
|
},
|
|
"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": {
|
|
"stream_sessions_owner_user_id_users_id_fk": {
|
|
"name": "stream_sessions_owner_user_id_users_id_fk",
|
|
"tableFrom": "stream_sessions",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"owner_user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"stream_sessions_camera_device_id_devices_id_fk": {
|
|
"name": "stream_sessions_camera_device_id_devices_id_fk",
|
|
"tableFrom": "stream_sessions",
|
|
"tableTo": "devices",
|
|
"columnsFrom": [
|
|
"camera_device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"stream_sessions_requester_device_id_devices_id_fk": {
|
|
"name": "stream_sessions_requester_device_id_devices_id_fk",
|
|
"tableFrom": "stream_sessions",
|
|
"tableTo": "devices",
|
|
"columnsFrom": [
|
|
"requester_device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.users": {
|
|
"name": "users",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"password_hash": {
|
|
"name": "password_hash",
|
|
"type": "varchar(255)",
|
|
"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 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": {
|
|
"users_email_unique": {
|
|
"name": "users_email_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"email"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.verification": {
|
|
"name": "verification",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"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 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": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.videos": {
|
|
"name": "videos",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"event_id": {
|
|
"name": "event_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"device_id": {
|
|
"name": "device_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"object_key": {
|
|
"name": "object_key",
|
|
"type": "varchar(1024)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"bucket": {
|
|
"name": "bucket",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"upload_url": {
|
|
"name": "upload_url",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"download_url": {
|
|
"name": "download_url",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'pending'"
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_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": {
|
|
"videos_event_id_events_id_fk": {
|
|
"name": "videos_event_id_events_id_fk",
|
|
"tableFrom": "videos",
|
|
"tableTo": "events",
|
|
"columnsFrom": [
|
|
"event_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"videos_user_id_users_id_fk": {
|
|
"name": "videos_user_id_users_id_fk",
|
|
"tableFrom": "videos",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"videos_device_id_devices_id_fk": {
|
|
"name": "videos_device_id_devices_id_fk",
|
|
"tableFrom": "videos",
|
|
"tableTo": "devices",
|
|
"columnsFrom": [
|
|
"device_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"videos_object_key_unique": {
|
|
"name": "videos_object_key_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"object_key"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
}
|
|
},
|
|
"enums": {},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
} |