The deck had two answers, which is a lot to hang on a swipe: send this pro a job right now, or lose them. Three more, in one fixed row (DESIGN.md §6.8): rewind · ✗ · watch · ✓ · ask Size is the hierarchy — the two that end the card stay 64px, the three that do not are 44px, never below the §8 floor. Rewind is disabled rather than hidden when there is nothing to undo, so the row never changes length and the big pair never moves out from under a thumb. Rewind is local. The entry deck writes no swipes — a `swipes` row is job-scoped and there is no job there — so the card leaving was only ever an index move. Watch: "tell me when this one is free" - `pro_watches` snapshots the pro's availability AT WATCH TIME, because the trigger is a change, not a state. Without it a sweep would notify every watcher on every run, since "available" stays true for as long as they stay available. - Deliberately the narrow version: a pro with is_accepting_jobs = false is invisible everywhere (eligibleProAtAnyDistance requires it), so a watch can only be placed on somebody already free and fires on the away-and-back cycle. "Free at a time that suits me" needs pro_availability — seeded since M1, read by nothing — to become a real calendar. Flagged rather than faked. Ask: a question, before there is a job - This is the first way to reach a pro who has not agreed to anything. Chat was gated behind message → match → accepted request → job, and that gate is what made a pro's inbox worth opening, so the cap is not decoration: MAX_OPEN_ENQUIRIES unanswered at a time, one thread per pair so it cannot be walked around, answered threads stop counting, stale ones fall out, and the pro can close one. - `enquiries` is its own table, not a match with a null job: a match means a pro said yes to specific work, and collapsing the two would put rows in `matches` that no quote, booking or review could hang off. - `messages` now belongs to a match OR an enquiry, with a CHECK making the illegal state unrepresentable. One message table, so one chat screen. 283 tests passing; typecheck and lint clean across 7 packages. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
3665 lines
93 KiB
JSON
3665 lines
93 KiB
JSON
{
|
|
"id": "64a69c9f-b1fc-423a-8dc8-b0d919a3f930",
|
|
"prevId": "fd5a810f-0b8d-4405-9a4b-c7d387b1101a",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"public.accounts": {
|
|
"name": "accounts",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"issuer": {
|
|
"name": "issuer",
|
|
"type": "text",
|
|
"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
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"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 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
|
|
},
|
|
"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": {
|
|
"accounts_user_idx": {
|
|
"name": "accounts_user_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"accounts_user_id_users_id_fk": {
|
|
"name": "accounts_user_id_users_id_fk",
|
|
"tableFrom": "accounts",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"accounts_issuer_account_unique": {
|
|
"name": "accounts_issuer_account_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"issuer",
|
|
"account_id"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.sessions": {
|
|
"name": "sessions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"token": {
|
|
"name": "token",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"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
|
|
},
|
|
"impersonated_by": {
|
|
"name": "impersonated_by",
|
|
"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": {
|
|
"sessions_user_idx": {
|
|
"name": "sessions_user_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"sessions_user_id_users_id_fk": {
|
|
"name": "sessions_user_id_users_id_fk",
|
|
"tableFrom": "sessions",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"sessions_impersonated_by_users_id_fk": {
|
|
"name": "sessions_impersonated_by_users_id_fk",
|
|
"tableFrom": "sessions",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"impersonated_by"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"sessions_token_unique": {
|
|
"name": "sessions_token_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"token"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.users": {
|
|
"name": "users",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"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
|
|
},
|
|
"phone": {
|
|
"name": "phone",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"phone_verified": {
|
|
"name": "phone_verified",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": false
|
|
},
|
|
"phone_verified_at": {
|
|
"name": "phone_verified_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"image": {
|
|
"name": "image",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"role": {
|
|
"name": "role",
|
|
"type": "user_role",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'client'"
|
|
},
|
|
"banned": {
|
|
"name": "banned",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": false
|
|
},
|
|
"ban_reason": {
|
|
"name": "ban_reason",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ban_expires": {
|
|
"name": "ban_expires",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"location": {
|
|
"name": "location",
|
|
"type": "geography(Point,4326)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"location_text": {
|
|
"name": "location_text",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"location_precision": {
|
|
"name": "location_precision",
|
|
"type": "location_precision",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'city'"
|
|
},
|
|
"location_place_id": {
|
|
"name": "location_place_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"search_radius_m": {
|
|
"name": "search_radius_m",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 15000
|
|
},
|
|
"last_active_at": {
|
|
"name": "last_active_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"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": {
|
|
"users_role_idx": {
|
|
"name": "users_role_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "role",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"users_phone_idx": {
|
|
"name": "users_phone_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "phone",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"users_email_unique": {
|
|
"name": "users_email_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"email"
|
|
]
|
|
},
|
|
"users_phone_unique": {
|
|
"name": "users_phone_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"phone"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.verifications": {
|
|
"name": "verifications",
|
|
"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": {
|
|
"verifications_identifier_idx": {
|
|
"name": "verifications_identifier_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "identifier",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "expires_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.categories": {
|
|
"name": "categories",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"slug": {
|
|
"name": "slug",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"icon": {
|
|
"name": "icon",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"position": {
|
|
"name": "position",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"is_active": {
|
|
"name": "is_active",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"categories_slug_unique": {
|
|
"name": "categories_slug_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"slug"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.credentials": {
|
|
"name": "credentials",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"pro_id": {
|
|
"name": "pro_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"kind": {
|
|
"name": "kind",
|
|
"type": "credential_kind",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"file_key": {
|
|
"name": "file_key",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"issuer": {
|
|
"name": "issuer",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"review_status": {
|
|
"name": "review_status",
|
|
"type": "review_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'pending'"
|
|
},
|
|
"reviewed_by": {
|
|
"name": "reviewed_by",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"reviewed_at": {
|
|
"name": "reviewed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"review_notes": {
|
|
"name": "review_notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"credentials_pro_idx": {
|
|
"name": "credentials_pro_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "pro_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"credentials_review_idx": {
|
|
"name": "credentials_review_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "review_status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"credentials_expiry_idx": {
|
|
"name": "credentials_expiry_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "expires_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"credentials_pro_id_pro_profiles_user_id_fk": {
|
|
"name": "credentials_pro_id_pro_profiles_user_id_fk",
|
|
"tableFrom": "credentials",
|
|
"tableTo": "pro_profiles",
|
|
"columnsFrom": [
|
|
"pro_id"
|
|
],
|
|
"columnsTo": [
|
|
"user_id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"credentials_reviewed_by_users_id_fk": {
|
|
"name": "credentials_reviewed_by_users_id_fk",
|
|
"tableFrom": "credentials",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"reviewed_by"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.pro_availability": {
|
|
"name": "pro_availability",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"pro_id": {
|
|
"name": "pro_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"weekday": {
|
|
"name": "weekday",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"start_minute": {
|
|
"name": "start_minute",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"end_minute": {
|
|
"name": "end_minute",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {
|
|
"pro_availability_pro_idx": {
|
|
"name": "pro_availability_pro_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "pro_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "weekday",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"pro_availability_pro_id_pro_profiles_user_id_fk": {
|
|
"name": "pro_availability_pro_id_pro_profiles_user_id_fk",
|
|
"tableFrom": "pro_availability",
|
|
"tableTo": "pro_profiles",
|
|
"columnsFrom": [
|
|
"pro_id"
|
|
],
|
|
"columnsTo": [
|
|
"user_id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.pro_categories": {
|
|
"name": "pro_categories",
|
|
"schema": "",
|
|
"columns": {
|
|
"pro_id": {
|
|
"name": "pro_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"category_id": {
|
|
"name": "category_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {
|
|
"pro_categories_category_idx": {
|
|
"name": "pro_categories_category_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "category_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"pro_categories_pro_id_pro_profiles_user_id_fk": {
|
|
"name": "pro_categories_pro_id_pro_profiles_user_id_fk",
|
|
"tableFrom": "pro_categories",
|
|
"tableTo": "pro_profiles",
|
|
"columnsFrom": [
|
|
"pro_id"
|
|
],
|
|
"columnsTo": [
|
|
"user_id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"pro_categories_category_id_categories_id_fk": {
|
|
"name": "pro_categories_category_id_categories_id_fk",
|
|
"tableFrom": "pro_categories",
|
|
"tableTo": "categories",
|
|
"columnsFrom": [
|
|
"category_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"pro_categories_pro_id_category_id_pk": {
|
|
"name": "pro_categories_pro_id_category_id_pk",
|
|
"columns": [
|
|
"pro_id",
|
|
"category_id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.pro_media": {
|
|
"name": "pro_media",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"pro_id": {
|
|
"name": "pro_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"url": {
|
|
"name": "url",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"kind": {
|
|
"name": "kind",
|
|
"type": "media_kind",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'photo'"
|
|
},
|
|
"position": {
|
|
"name": "position",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"pro_media_pro_idx": {
|
|
"name": "pro_media_pro_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "pro_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "position",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"pro_media_pro_id_pro_profiles_user_id_fk": {
|
|
"name": "pro_media_pro_id_pro_profiles_user_id_fk",
|
|
"tableFrom": "pro_media",
|
|
"tableTo": "pro_profiles",
|
|
"columnsFrom": [
|
|
"pro_id"
|
|
],
|
|
"columnsTo": [
|
|
"user_id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.pro_profiles": {
|
|
"name": "pro_profiles",
|
|
"schema": "",
|
|
"columns": {
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"headline": {
|
|
"name": "headline",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"bio": {
|
|
"name": "bio",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"hourly_rate_cents": {
|
|
"name": "hourly_rate_cents",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"years_experience": {
|
|
"name": "years_experience",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"base_location": {
|
|
"name": "base_location",
|
|
"type": "geography(Point,4326)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"base_location_precision": {
|
|
"name": "base_location_precision",
|
|
"type": "location_precision",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'city'"
|
|
},
|
|
"base_location_place_id": {
|
|
"name": "base_location_place_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"service_radius_m": {
|
|
"name": "service_radius_m",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 15000
|
|
},
|
|
"skills": {
|
|
"name": "skills",
|
|
"type": "text[]",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::text[]"
|
|
},
|
|
"verification_status": {
|
|
"name": "verification_status",
|
|
"type": "verification_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'draft'"
|
|
},
|
|
"verified_at": {
|
|
"name": "verified_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"suspended_reason": {
|
|
"name": "suspended_reason",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"is_accepting_jobs": {
|
|
"name": "is_accepting_jobs",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"rating_avg": {
|
|
"name": "rating_avg",
|
|
"type": "numeric(3, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"rating_count": {
|
|
"name": "rating_count",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"completed_jobs": {
|
|
"name": "completed_jobs",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"response_rate": {
|
|
"name": "response_rate",
|
|
"type": "numeric(4, 3)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"avg_response_minutes": {
|
|
"name": "avg_response_minutes",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"stripe_account_id": {
|
|
"name": "stripe_account_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"stripe_payouts_enabled": {
|
|
"name": "stripe_payouts_enabled",
|
|
"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": {
|
|
"pro_profiles_location_gist": {
|
|
"name": "pro_profiles_location_gist",
|
|
"columns": [
|
|
{
|
|
"expression": "base_location",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "gist",
|
|
"with": {}
|
|
},
|
|
"pro_profiles_deck_idx": {
|
|
"name": "pro_profiles_deck_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "verification_status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "is_accepting_jobs",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"where": "\"pro_profiles\".\"verification_status\" = 'verified' AND \"pro_profiles\".\"is_accepting_jobs\" = true",
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"pro_profiles_user_id_users_id_fk": {
|
|
"name": "pro_profiles_user_id_users_id_fk",
|
|
"tableFrom": "pro_profiles",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"pro_profiles_stripe_account_id_unique": {
|
|
"name": "pro_profiles_stripe_account_id_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"stripe_account_id"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.verification_sessions": {
|
|
"name": "verification_sessions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"pro_id": {
|
|
"name": "pro_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"provider": {
|
|
"name": "provider",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'didit'"
|
|
},
|
|
"external_id": {
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'pending'"
|
|
},
|
|
"decision": {
|
|
"name": "decision",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"raw_payload": {
|
|
"name": "raw_payload",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"completed_at": {
|
|
"name": "completed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"verification_sessions_pro_idx": {
|
|
"name": "verification_sessions_pro_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "pro_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"verification_sessions_pro_id_pro_profiles_user_id_fk": {
|
|
"name": "verification_sessions_pro_id_pro_profiles_user_id_fk",
|
|
"tableFrom": "verification_sessions",
|
|
"tableTo": "pro_profiles",
|
|
"columnsFrom": [
|
|
"pro_id"
|
|
],
|
|
"columnsTo": [
|
|
"user_id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"verification_sessions_external_id_unique": {
|
|
"name": "verification_sessions_external_id_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"external_id"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.jobs": {
|
|
"name": "jobs",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"client_id": {
|
|
"name": "client_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"category_id": {
|
|
"name": "category_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"photos": {
|
|
"name": "photos",
|
|
"type": "text[]",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::text[]"
|
|
},
|
|
"urgency": {
|
|
"name": "urgency",
|
|
"type": "urgency",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'flexible'"
|
|
},
|
|
"budget_min_cents": {
|
|
"name": "budget_min_cents",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"budget_max_cents": {
|
|
"name": "budget_max_cents",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"location": {
|
|
"name": "location",
|
|
"type": "geography(Point,4326)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"location_precision": {
|
|
"name": "location_precision",
|
|
"type": "location_precision",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'city'"
|
|
},
|
|
"location_place_id": {
|
|
"name": "location_place_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"address_text": {
|
|
"name": "address_text",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "job_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'open'"
|
|
},
|
|
"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": {
|
|
"jobs_location_gist": {
|
|
"name": "jobs_location_gist",
|
|
"columns": [
|
|
{
|
|
"expression": "location",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "gist",
|
|
"with": {}
|
|
},
|
|
"jobs_client_idx": {
|
|
"name": "jobs_client_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "client_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"jobs_open_idx": {
|
|
"name": "jobs_open_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "category_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"where": "\"jobs\".\"status\" = 'open'",
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"jobs_client_id_users_id_fk": {
|
|
"name": "jobs_client_id_users_id_fk",
|
|
"tableFrom": "jobs",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"client_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"jobs_category_id_categories_id_fk": {
|
|
"name": "jobs_category_id_categories_id_fk",
|
|
"tableFrom": "jobs",
|
|
"tableTo": "categories",
|
|
"columnsFrom": [
|
|
"category_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.matches": {
|
|
"name": "matches",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"request_id": {
|
|
"name": "request_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"job_id": {
|
|
"name": "job_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"pro_id": {
|
|
"name": "pro_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"client_id": {
|
|
"name": "client_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"last_message_at": {
|
|
"name": "last_message_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": {
|
|
"matches_pro_idx": {
|
|
"name": "matches_pro_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "pro_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "last_message_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"matches_client_idx": {
|
|
"name": "matches_client_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "client_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "last_message_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"matches_job_idx": {
|
|
"name": "matches_job_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "job_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"matches_request_id_requests_id_fk": {
|
|
"name": "matches_request_id_requests_id_fk",
|
|
"tableFrom": "matches",
|
|
"tableTo": "requests",
|
|
"columnsFrom": [
|
|
"request_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"matches_job_id_jobs_id_fk": {
|
|
"name": "matches_job_id_jobs_id_fk",
|
|
"tableFrom": "matches",
|
|
"tableTo": "jobs",
|
|
"columnsFrom": [
|
|
"job_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"matches_pro_id_pro_profiles_user_id_fk": {
|
|
"name": "matches_pro_id_pro_profiles_user_id_fk",
|
|
"tableFrom": "matches",
|
|
"tableTo": "pro_profiles",
|
|
"columnsFrom": [
|
|
"pro_id"
|
|
],
|
|
"columnsTo": [
|
|
"user_id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"matches_client_id_users_id_fk": {
|
|
"name": "matches_client_id_users_id_fk",
|
|
"tableFrom": "matches",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"client_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"matches_request_id_unique": {
|
|
"name": "matches_request_id_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"request_id"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.requests": {
|
|
"name": "requests",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"job_id": {
|
|
"name": "job_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"pro_id": {
|
|
"name": "pro_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "request_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'pending'"
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"responded_at": {
|
|
"name": "responded_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": {
|
|
"requests_pending_idx": {
|
|
"name": "requests_pending_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "pro_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "expires_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"where": "\"requests\".\"status\" = 'pending'",
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"requests_job_idx": {
|
|
"name": "requests_job_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "job_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"requests_job_id_jobs_id_fk": {
|
|
"name": "requests_job_id_jobs_id_fk",
|
|
"tableFrom": "requests",
|
|
"tableTo": "jobs",
|
|
"columnsFrom": [
|
|
"job_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"requests_pro_id_pro_profiles_user_id_fk": {
|
|
"name": "requests_pro_id_pro_profiles_user_id_fk",
|
|
"tableFrom": "requests",
|
|
"tableTo": "pro_profiles",
|
|
"columnsFrom": [
|
|
"pro_id"
|
|
],
|
|
"columnsTo": [
|
|
"user_id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"requests_job_pro_unique": {
|
|
"name": "requests_job_pro_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"job_id",
|
|
"pro_id"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.swipes": {
|
|
"name": "swipes",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"job_id": {
|
|
"name": "job_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"pro_id": {
|
|
"name": "pro_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"direction": {
|
|
"name": "direction",
|
|
"type": "swipe_direction",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"swipes_job_idx": {
|
|
"name": "swipes_job_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "job_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"swipes_job_id_jobs_id_fk": {
|
|
"name": "swipes_job_id_jobs_id_fk",
|
|
"tableFrom": "swipes",
|
|
"tableTo": "jobs",
|
|
"columnsFrom": [
|
|
"job_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"swipes_pro_id_pro_profiles_user_id_fk": {
|
|
"name": "swipes_pro_id_pro_profiles_user_id_fk",
|
|
"tableFrom": "swipes",
|
|
"tableTo": "pro_profiles",
|
|
"columnsFrom": [
|
|
"pro_id"
|
|
],
|
|
"columnsTo": [
|
|
"user_id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"swipes_job_pro_unique": {
|
|
"name": "swipes_job_pro_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"job_id",
|
|
"pro_id"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.enquiries": {
|
|
"name": "enquiries",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"client_id": {
|
|
"name": "client_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"pro_id": {
|
|
"name": "pro_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"responded_at": {
|
|
"name": "responded_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"last_message_at": {
|
|
"name": "last_message_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"closed_at": {
|
|
"name": "closed_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": {
|
|
"enquiries_pro_idx": {
|
|
"name": "enquiries_pro_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "pro_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "last_message_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"enquiries_client_idx": {
|
|
"name": "enquiries_client_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "client_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "last_message_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"enquiries_client_id_users_id_fk": {
|
|
"name": "enquiries_client_id_users_id_fk",
|
|
"tableFrom": "enquiries",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"client_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"enquiries_pro_id_pro_profiles_user_id_fk": {
|
|
"name": "enquiries_pro_id_pro_profiles_user_id_fk",
|
|
"tableFrom": "enquiries",
|
|
"tableTo": "pro_profiles",
|
|
"columnsFrom": [
|
|
"pro_id"
|
|
],
|
|
"columnsTo": [
|
|
"user_id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"enquiries_pair_unique": {
|
|
"name": "enquiries_pair_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"client_id",
|
|
"pro_id"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.pro_watches": {
|
|
"name": "pro_watches",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"watcher_id": {
|
|
"name": "watcher_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"pro_id": {
|
|
"name": "pro_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"available_at_watch": {
|
|
"name": "available_at_watch",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'true'"
|
|
},
|
|
"notified_at": {
|
|
"name": "notified_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": {
|
|
"pro_watches_pro_idx": {
|
|
"name": "pro_watches_pro_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "pro_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "notified_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"pro_watches_watcher_idx": {
|
|
"name": "pro_watches_watcher_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "watcher_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"pro_watches_watcher_id_users_id_fk": {
|
|
"name": "pro_watches_watcher_id_users_id_fk",
|
|
"tableFrom": "pro_watches",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"watcher_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"pro_watches_pro_id_pro_profiles_user_id_fk": {
|
|
"name": "pro_watches_pro_id_pro_profiles_user_id_fk",
|
|
"tableFrom": "pro_watches",
|
|
"tableTo": "pro_profiles",
|
|
"columnsFrom": [
|
|
"pro_id"
|
|
],
|
|
"columnsTo": [
|
|
"user_id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"pro_watches_unique": {
|
|
"name": "pro_watches_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"watcher_id",
|
|
"pro_id"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.messages": {
|
|
"name": "messages",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"match_id": {
|
|
"name": "match_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"enquiry_id": {
|
|
"name": "enquiry_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"sender_id": {
|
|
"name": "sender_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"body": {
|
|
"name": "body",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"attachments": {
|
|
"name": "attachments",
|
|
"type": "text[]",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::text[]"
|
|
},
|
|
"read_at": {
|
|
"name": "read_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": {
|
|
"messages_match_idx": {
|
|
"name": "messages_match_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "match_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"messages_enquiry_idx": {
|
|
"name": "messages_enquiry_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "enquiry_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"messages_unread_idx": {
|
|
"name": "messages_unread_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "match_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "sender_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"where": "\"messages\".\"read_at\" IS NULL",
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"messages_enquiry_unread_idx": {
|
|
"name": "messages_enquiry_unread_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "enquiry_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "sender_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"where": "\"messages\".\"read_at\" IS NULL",
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"messages_match_id_matches_id_fk": {
|
|
"name": "messages_match_id_matches_id_fk",
|
|
"tableFrom": "messages",
|
|
"tableTo": "matches",
|
|
"columnsFrom": [
|
|
"match_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"messages_enquiry_id_enquiries_id_fk": {
|
|
"name": "messages_enquiry_id_enquiries_id_fk",
|
|
"tableFrom": "messages",
|
|
"tableTo": "enquiries",
|
|
"columnsFrom": [
|
|
"enquiry_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"messages_sender_id_users_id_fk": {
|
|
"name": "messages_sender_id_users_id_fk",
|
|
"tableFrom": "messages",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"sender_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {
|
|
"messages_one_parent": {
|
|
"name": "messages_one_parent",
|
|
"value": "(\"messages\".\"match_id\" IS NULL) <> (\"messages\".\"enquiry_id\" IS NULL)"
|
|
}
|
|
},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.bookings": {
|
|
"name": "bookings",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"match_id": {
|
|
"name": "match_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"quote_id": {
|
|
"name": "quote_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"scheduled_start": {
|
|
"name": "scheduled_start",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"scheduled_end": {
|
|
"name": "scheduled_end",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "booking_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'scheduled'"
|
|
},
|
|
"pro_completed_at": {
|
|
"name": "pro_completed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"client_confirmed_at": {
|
|
"name": "client_confirmed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"cancelled_at": {
|
|
"name": "cancelled_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"cancelled_by": {
|
|
"name": "cancelled_by",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"cancellation_reason": {
|
|
"name": "cancellation_reason",
|
|
"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": {
|
|
"bookings_match_idx": {
|
|
"name": "bookings_match_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "match_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"bookings_status_idx": {
|
|
"name": "bookings_status_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "pro_completed_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"bookings_schedule_idx": {
|
|
"name": "bookings_schedule_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "scheduled_start",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"bookings_match_id_matches_id_fk": {
|
|
"name": "bookings_match_id_matches_id_fk",
|
|
"tableFrom": "bookings",
|
|
"tableTo": "matches",
|
|
"columnsFrom": [
|
|
"match_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"bookings_quote_id_quotes_id_fk": {
|
|
"name": "bookings_quote_id_quotes_id_fk",
|
|
"tableFrom": "bookings",
|
|
"tableTo": "quotes",
|
|
"columnsFrom": [
|
|
"quote_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"bookings_cancelled_by_users_id_fk": {
|
|
"name": "bookings_cancelled_by_users_id_fk",
|
|
"tableFrom": "bookings",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"cancelled_by"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.payments": {
|
|
"name": "payments",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"booking_id": {
|
|
"name": "booking_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"stripe_payment_intent_id": {
|
|
"name": "stripe_payment_intent_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"stripe_transfer_id": {
|
|
"name": "stripe_transfer_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"stripe_refund_id": {
|
|
"name": "stripe_refund_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"amount_cents": {
|
|
"name": "amount_cents",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"platform_fee_cents": {
|
|
"name": "platform_fee_cents",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"platform_fee_bps": {
|
|
"name": "platform_fee_bps",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"refunded_cents": {
|
|
"name": "refunded_cents",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"currency": {
|
|
"name": "currency",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'eur'"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "payment_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'pending'"
|
|
},
|
|
"captured_at": {
|
|
"name": "captured_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"released_at": {
|
|
"name": "released_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"failure_reason": {
|
|
"name": "failure_reason",
|
|
"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": {
|
|
"payments_status_idx": {
|
|
"name": "payments_status_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"payments_intent_idx": {
|
|
"name": "payments_intent_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "stripe_payment_intent_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"payments_booking_id_bookings_id_fk": {
|
|
"name": "payments_booking_id_bookings_id_fk",
|
|
"tableFrom": "payments",
|
|
"tableTo": "bookings",
|
|
"columnsFrom": [
|
|
"booking_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"payments_booking_id_unique": {
|
|
"name": "payments_booking_id_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"booking_id"
|
|
]
|
|
},
|
|
"payments_stripe_payment_intent_id_unique": {
|
|
"name": "payments_stripe_payment_intent_id_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"stripe_payment_intent_id"
|
|
]
|
|
},
|
|
"payments_stripe_transfer_id_unique": {
|
|
"name": "payments_stripe_transfer_id_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"stripe_transfer_id"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.processed_stripe_events": {
|
|
"name": "processed_stripe_events",
|
|
"schema": "",
|
|
"columns": {
|
|
"event_id": {
|
|
"name": "event_id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"processed_at": {
|
|
"name": "processed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.quotes": {
|
|
"name": "quotes",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"match_id": {
|
|
"name": "match_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"kind": {
|
|
"name": "kind",
|
|
"type": "quote_kind",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'fixed'"
|
|
},
|
|
"amount_cents": {
|
|
"name": "amount_cents",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"hours_estimate": {
|
|
"name": "hours_estimate",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"scope": {
|
|
"name": "scope",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "quote_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'sent'"
|
|
},
|
|
"valid_until": {
|
|
"name": "valid_until",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"responded_at": {
|
|
"name": "responded_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": {
|
|
"quotes_match_idx": {
|
|
"name": "quotes_match_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "match_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"quotes_match_id_matches_id_fk": {
|
|
"name": "quotes_match_id_matches_id_fk",
|
|
"tableFrom": "quotes",
|
|
"tableTo": "matches",
|
|
"columnsFrom": [
|
|
"match_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.reviews": {
|
|
"name": "reviews",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"booking_id": {
|
|
"name": "booking_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"author_id": {
|
|
"name": "author_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"subject_id": {
|
|
"name": "subject_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"rating": {
|
|
"name": "rating",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"body": {
|
|
"name": "body",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"published_at": {
|
|
"name": "published_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": {
|
|
"reviews_subject_idx": {
|
|
"name": "reviews_subject_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "subject_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "published_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"reviews_booking_id_bookings_id_fk": {
|
|
"name": "reviews_booking_id_bookings_id_fk",
|
|
"tableFrom": "reviews",
|
|
"tableTo": "bookings",
|
|
"columnsFrom": [
|
|
"booking_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"reviews_author_id_users_id_fk": {
|
|
"name": "reviews_author_id_users_id_fk",
|
|
"tableFrom": "reviews",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"author_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"reviews_subject_id_users_id_fk": {
|
|
"name": "reviews_subject_id_users_id_fk",
|
|
"tableFrom": "reviews",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"subject_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"reviews_booking_author_unique": {
|
|
"name": "reviews_booking_author_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"booking_id",
|
|
"author_id"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.audit_log": {
|
|
"name": "audit_log",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"actor_id": {
|
|
"name": "actor_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"action": {
|
|
"name": "action",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"entity": {
|
|
"name": "entity",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"entity_id": {
|
|
"name": "entity_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"metadata": {
|
|
"name": "metadata",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ip": {
|
|
"name": "ip",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"audit_log_entity_idx": {
|
|
"name": "audit_log_entity_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "entity",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "entity_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"audit_log_actor_idx": {
|
|
"name": "audit_log_actor_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "actor_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"audit_log_actor_id_users_id_fk": {
|
|
"name": "audit_log_actor_id_users_id_fk",
|
|
"tableFrom": "audit_log",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"actor_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.deletion_requests": {
|
|
"name": "deletion_requests",
|
|
"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
|
|
},
|
|
"reason": {
|
|
"name": "reason",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"actioned_at": {
|
|
"name": "actioned_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": {
|
|
"deletion_requests_user_id_users_id_fk": {
|
|
"name": "deletion_requests_user_id_users_id_fk",
|
|
"tableFrom": "deletion_requests",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.email_change_requests": {
|
|
"name": "email_change_requests",
|
|
"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
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "text",
|
|
"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
|
|
},
|
|
"consumed_at": {
|
|
"name": "consumed_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": {
|
|
"email_change_requests_user_id_users_id_fk": {
|
|
"name": "email_change_requests_user_id_users_id_fk",
|
|
"tableFrom": "email_change_requests",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"email_change_requests_token_unique": {
|
|
"name": "email_change_requests_token_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"token"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.notification_deliveries": {
|
|
"name": "notification_deliveries",
|
|
"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
|
|
},
|
|
"kind": {
|
|
"name": "kind",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"channel": {
|
|
"name": "channel",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"detail": {
|
|
"name": "detail",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"notification_deliveries_user_idx": {
|
|
"name": "notification_deliveries_user_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"notification_deliveries_status_idx": {
|
|
"name": "notification_deliveries_status_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"notification_deliveries_user_id_users_id_fk": {
|
|
"name": "notification_deliveries_user_id_users_id_fk",
|
|
"tableFrom": "notification_deliveries",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.notification_preferences": {
|
|
"name": "notification_preferences",
|
|
"schema": "",
|
|
"columns": {
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"sms_new_request": {
|
|
"name": "sms_new_request",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"sms_booking_reminder": {
|
|
"name": "sms_booking_reminder",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"sms_marketing": {
|
|
"name": "sms_marketing",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"email_receipts": {
|
|
"name": "email_receipts",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"email_marketing": {
|
|
"name": "email_marketing",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"push_messages": {
|
|
"name": "push_messages",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"push_requests": {
|
|
"name": "push_requests",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"notification_preferences_user_id_users_id_fk": {
|
|
"name": "notification_preferences_user_id_users_id_fk",
|
|
"tableFrom": "notification_preferences",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
}
|
|
},
|
|
"enums": {
|
|
"public.booking_status": {
|
|
"name": "booking_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"scheduled",
|
|
"in_progress",
|
|
"awaiting_confirmation",
|
|
"completed",
|
|
"cancelled",
|
|
"disputed"
|
|
]
|
|
},
|
|
"public.credential_kind": {
|
|
"name": "credential_kind",
|
|
"schema": "public",
|
|
"values": [
|
|
"id",
|
|
"licence",
|
|
"insurance"
|
|
]
|
|
},
|
|
"public.job_status": {
|
|
"name": "job_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"open",
|
|
"matched",
|
|
"booked",
|
|
"completed",
|
|
"cancelled"
|
|
]
|
|
},
|
|
"public.location_precision": {
|
|
"name": "location_precision",
|
|
"schema": "public",
|
|
"values": [
|
|
"exact",
|
|
"approximate",
|
|
"city"
|
|
]
|
|
},
|
|
"public.media_kind": {
|
|
"name": "media_kind",
|
|
"schema": "public",
|
|
"values": [
|
|
"photo",
|
|
"work_sample"
|
|
]
|
|
},
|
|
"public.payment_status": {
|
|
"name": "payment_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"pending",
|
|
"held",
|
|
"released",
|
|
"refunded",
|
|
"partially_refunded",
|
|
"failed"
|
|
]
|
|
},
|
|
"public.quote_kind": {
|
|
"name": "quote_kind",
|
|
"schema": "public",
|
|
"values": [
|
|
"fixed",
|
|
"hourly"
|
|
]
|
|
},
|
|
"public.quote_status": {
|
|
"name": "quote_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"sent",
|
|
"accepted",
|
|
"declined",
|
|
"withdrawn",
|
|
"expired"
|
|
]
|
|
},
|
|
"public.request_status": {
|
|
"name": "request_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"pending",
|
|
"accepted",
|
|
"declined",
|
|
"expired"
|
|
]
|
|
},
|
|
"public.review_status": {
|
|
"name": "review_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"pending",
|
|
"approved",
|
|
"rejected"
|
|
]
|
|
},
|
|
"public.swipe_direction": {
|
|
"name": "swipe_direction",
|
|
"schema": "public",
|
|
"values": [
|
|
"left",
|
|
"right"
|
|
]
|
|
},
|
|
"public.urgency": {
|
|
"name": "urgency",
|
|
"schema": "public",
|
|
"values": [
|
|
"now",
|
|
"this_week",
|
|
"flexible"
|
|
]
|
|
},
|
|
"public.user_role": {
|
|
"name": "user_role",
|
|
"schema": "public",
|
|
"values": [
|
|
"client",
|
|
"pro",
|
|
"admin"
|
|
]
|
|
},
|
|
"public.verification_status": {
|
|
"name": "verification_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"draft",
|
|
"pending",
|
|
"verified",
|
|
"rejected",
|
|
"suspended"
|
|
]
|
|
}
|
|
},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
} |