{
  "id": "00000000-0000-0000-0000-000000000000",
  "prevId": "",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.customers": {
      "name": "customers",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "phone": {
          "name": "phone",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "preferences": {
          "name": "preferences",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "tags": {
          "name": "tags",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "total_visits": {
          "name": "total_visits",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "total_spend": {
          "name": "total_spend",
          "type": "numeric(10, 2)",
          "primaryKey": false,
          "notNull": false,
          "default": "'0'"
        },
        "tier": {
          "name": "tier",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'bronze'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "idx_customers_restaurant_id": {
          "name": "idx_customers_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "customers_restaurant_id_fkey": {
          "name": "customers_restaurant_id_fkey",
          "tableFrom": "customers",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.admin_users": {
      "name": "admin_users",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "password_hash": {
          "name": "password_hash",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "admin_role",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'support'"
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "admin_users_email_key": {
          "columns": [
            "email"
          ],
          "nullsNotDistinct": false,
          "name": "admin_users_email_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.plans": {
      "name": "plans",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "price_monthly": {
          "name": "price_monthly",
          "type": "numeric(10, 2)",
          "primaryKey": false,
          "notNull": true,
          "default": "'0'"
        },
        "price_annual": {
          "name": "price_annual",
          "type": "numeric(10, 2)",
          "primaryKey": false,
          "notNull": true,
          "default": "'0'"
        },
        "features": {
          "name": "features",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "limits": {
          "name": "limits",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'::jsonb"
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "stripe_price_id_monthly": {
          "name": "stripe_price_id_monthly",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "stripe_price_id_annual": {
          "name": "stripe_price_id_annual",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "stripe_product_id": {
          "name": "stripe_product_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "trial_days": {
          "name": "trial_days",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 14
        },
        "slug": {
          "name": "slug",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "idx_plans_slug": {
          "name": "idx_plans_slug",
          "columns": [
            {
              "expression": "slug",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.subscriptions": {
      "name": "subscriptions",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "plan_id": {
          "name": "plan_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "plan_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'trial'"
        },
        "current_period_end": {
          "name": "current_period_end",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "stripe_customer_id": {
          "name": "stripe_customer_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "stripe_subscription_id": {
          "name": "stripe_subscription_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "stripe_price_id": {
          "name": "stripe_price_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "trial_start": {
          "name": "trial_start",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "trial_end": {
          "name": "trial_end",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "subscriptions_plan_id_fkey": {
          "name": "subscriptions_plan_id_fkey",
          "tableFrom": "subscriptions",
          "tableTo": "plans",
          "schemaTo": "public",
          "columnsFrom": [
            "plan_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "subscriptions_restaurant_id_fkey": {
          "name": "subscriptions_restaurant_id_fkey",
          "tableFrom": "subscriptions",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "subscriptions_restaurant_id_key": {
          "columns": [
            "restaurant_id"
          ],
          "nullsNotDistinct": false,
          "name": "subscriptions_restaurant_id_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.branches": {
      "name": "branches",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "address": {
          "name": "address",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "phone": {
          "name": "phone",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "hours": {
          "name": "hours",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'::jsonb"
        },
        "timezone": {
          "name": "timezone",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'UTC'"
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "smtp_host": {
          "name": "smtp_host",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "smtp_port": {
          "name": "smtp_port",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "smtp_user": {
          "name": "smtp_user",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "smtp_pass": {
          "name": "smtp_pass",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "smtp_from": {
          "name": "smtp_from",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "idx_branches_restaurant_id": {
          "name": "idx_branches_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "branches_restaurant_id_fkey": {
          "name": "branches_restaurant_id_fkey",
          "tableFrom": "branches",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.restaurants": {
      "name": "restaurants",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "owner_id": {
          "name": "owner_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "plan": {
          "name": "plan",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'starter'"
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'active'"
        },
        "logo_url": {
          "name": "logo_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "currency": {
          "name": "currency",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "currency_locked": {
          "name": "currency_locked",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "currency_set_at": {
          "name": "currency_set_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "cuisine_type": {
          "name": "cuisine_type",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "phone": {
          "name": "phone",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "address": {
          "name": "address",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "seating_capacity": {
          "name": "seating_capacity",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "display_id": {
          "name": "display_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "idx_restaurants_display_id": {
          "name": "idx_restaurants_display_id",
          "columns": [
            {
              "expression": "display_id",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_restaurants_owner_id": {
          "name": "idx_restaurants_owner_id",
          "columns": [
            {
              "expression": "owner_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.users": {
      "name": "users",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "role": {
          "name": "role",
          "type": "user_role",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'staff'"
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "''"
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "password_hash": {
          "name": "password_hash",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "preferred_language": {
          "name": "preferred_language",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'en'"
        }
      },
      "indexes": {
        "idx_users_email": {
          "name": "idx_users_email",
          "columns": [
            {
              "expression": "email",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_users_restaurant_id": {
          "name": "idx_users_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "users_branch_id_fkey": {
          "name": "users_branch_id_fkey",
          "tableFrom": "users",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "users_restaurant_id_fkey": {
          "name": "users_restaurant_id_fkey",
          "tableFrom": "users",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "users_email_key": {
          "columns": [
            "email"
          ],
          "nullsNotDistinct": false,
          "name": "users_email_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.orders": {
      "name": "orders",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "customer_id": {
          "name": "customer_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "customer_name": {
          "name": "customer_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "customer_phone": {
          "name": "customer_phone",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "items": {
          "name": "items",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "status": {
          "name": "status",
          "type": "order_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'pending'"
        },
        "channel": {
          "name": "channel",
          "type": "channel_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'chat'"
        },
        "delivery_type": {
          "name": "delivery_type",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'dine-in'"
        },
        "table_number": {
          "name": "table_number",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "subtotal": {
          "name": "subtotal",
          "type": "numeric(10, 2)",
          "primaryKey": false,
          "notNull": false,
          "default": "'0'"
        },
        "tax": {
          "name": "tax",
          "type": "numeric(10, 2)",
          "primaryKey": false,
          "notNull": false,
          "default": "'0'"
        },
        "total": {
          "name": "total",
          "type": "numeric(10, 2)",
          "primaryKey": false,
          "notNull": false,
          "default": "'0'"
        },
        "ai_confidence": {
          "name": "ai_confidence",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "agent_id": {
          "name": "agent_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "conversation_id": {
          "name": "conversation_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "special_instructions": {
          "name": "special_instructions",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "transcript_summary": {
          "name": "transcript_summary",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "is_modified": {
          "name": "is_modified",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "modification_note": {
          "name": "modification_note",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "delivery_address": {
          "name": "delivery_address",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "order_number": {
          "name": "order_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "customer_email": {
          "name": "customer_email",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "idx_orders_branch_id": {
          "name": "idx_orders_branch_id",
          "columns": [
            {
              "expression": "branch_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_orders_created_at": {
          "name": "idx_orders_created_at",
          "columns": [
            {
              "expression": "created_at",
              "asc": false,
              "nulls": "first",
              "opclass": "timestamptz_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_orders_restaurant_id": {
          "name": "idx_orders_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_orders_restaurant_order_number": {
          "name": "idx_orders_restaurant_order_number",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "int4_ops",
              "isExpression": false
            },
            {
              "expression": "order_number",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_orders_status": {
          "name": "idx_orders_status",
          "columns": [
            {
              "expression": "status",
              "asc": true,
              "nulls": "last",
              "opclass": "enum_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "orders_branch_id_fkey": {
          "name": "orders_branch_id_fkey",
          "tableFrom": "orders",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "orders_customer_id_fkey": {
          "name": "orders_customer_id_fkey",
          "tableFrom": "orders",
          "tableTo": "customers",
          "schemaTo": "public",
          "columnsFrom": [
            "customer_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "orders_restaurant_id_fkey": {
          "name": "orders_restaurant_id_fkey",
          "tableFrom": "orders",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.bookings": {
      "name": "bookings",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "customer_id": {
          "name": "customer_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "guest_name": {
          "name": "guest_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "guest_phone": {
          "name": "guest_phone",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "guest_email": {
          "name": "guest_email",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "table_no": {
          "name": "table_no",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "party_size": {
          "name": "party_size",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 1
        },
        "booking_date": {
          "name": "booking_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false
        },
        "booking_time": {
          "name": "booking_time",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "zone": {
          "name": "zone",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "booking_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'pending'"
        },
        "channel": {
          "name": "channel",
          "type": "channel_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'chat'"
        },
        "occasion": {
          "name": "occasion",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "dietary_needs": {
          "name": "dietary_needs",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "special_requests": {
          "name": "special_requests",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "ai_notes": {
          "name": "ai_notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "ai_confidence": {
          "name": "ai_confidence",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "reminder_sent": {
          "name": "reminder_sent",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "is_vip": {
          "name": "is_vip",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "confirmation_channel": {
          "name": "confirmation_channel",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'none'"
        },
        "agent_id": {
          "name": "agent_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "conversation_id": {
          "name": "conversation_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_bookings_branch_id": {
          "name": "idx_bookings_branch_id",
          "columns": [
            {
              "expression": "branch_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_bookings_restaurant_id": {
          "name": "idx_bookings_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_bookings_status": {
          "name": "idx_bookings_status",
          "columns": [
            {
              "expression": "status",
              "asc": true,
              "nulls": "last",
              "opclass": "enum_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "bookings_branch_id_fkey": {
          "name": "bookings_branch_id_fkey",
          "tableFrom": "bookings",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "bookings_customer_id_fkey": {
          "name": "bookings_customer_id_fkey",
          "tableFrom": "bookings",
          "tableTo": "customers",
          "schemaTo": "public",
          "columnsFrom": [
            "customer_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "bookings_restaurant_id_fkey": {
          "name": "bookings_restaurant_id_fkey",
          "tableFrom": "bookings",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.menu_categories": {
      "name": "menu_categories",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "display_order": {
          "name": "display_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_menu_categories_restaurant_id": {
          "name": "idx_menu_categories_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "menu_categories_branch_id_fkey": {
          "name": "menu_categories_branch_id_fkey",
          "tableFrom": "menu_categories",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "menu_categories_restaurant_id_fkey": {
          "name": "menu_categories_restaurant_id_fkey",
          "tableFrom": "menu_categories",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.phone_numbers": {
      "name": "phone_numbers",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "number": {
          "name": "number",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "phone_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'purchased'"
        },
        "sip_config": {
          "name": "sip_config",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'::jsonb"
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "assigned_agent_id": {
          "name": "assigned_agent_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "display_name": {
          "name": "display_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "call_recording": {
          "name": "call_recording",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "call_transcription": {
          "name": "call_transcription",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "greeting_override": {
          "name": "greeting_override",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "twilio_number_sid": {
          "name": "twilio_number_sid",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "fallback_number": {
          "name": "fallback_number",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "idx_phone_numbers_assigned_agent": {
          "name": "idx_phone_numbers_assigned_agent",
          "columns": [
            {
              "expression": "assigned_agent_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_phone_numbers_restaurant_id": {
          "name": "idx_phone_numbers_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "phone_numbers_assigned_agent_id_fkey": {
          "name": "phone_numbers_assigned_agent_id_fkey",
          "tableFrom": "phone_numbers",
          "tableTo": "ai_agents",
          "schemaTo": "public",
          "columnsFrom": [
            "assigned_agent_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "phone_numbers_branch_id_fkey": {
          "name": "phone_numbers_branch_id_fkey",
          "tableFrom": "phone_numbers",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "phone_numbers_restaurant_id_fkey": {
          "name": "phone_numbers_restaurant_id_fkey",
          "tableFrom": "phone_numbers",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.conversations": {
      "name": "conversations",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "customer_id": {
          "name": "customer_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "customer_name": {
          "name": "customer_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "customer_avatar": {
          "name": "customer_avatar",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "channel": {
          "name": "channel",
          "type": "channel_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'chat'"
        },
        "status": {
          "name": "status",
          "type": "conversation_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'ai'"
        },
        "messages": {
          "name": "messages",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "topic": {
          "name": "topic",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "unread_count": {
          "name": "unread_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "ai_confidence": {
          "name": "ai_confidence",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "assigned_agent": {
          "name": "assigned_agent",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_conversations_restaurant_id": {
          "name": "idx_conversations_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_conversations_status": {
          "name": "idx_conversations_status",
          "columns": [
            {
              "expression": "status",
              "asc": true,
              "nulls": "last",
              "opclass": "enum_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "conversations_branch_id_fkey": {
          "name": "conversations_branch_id_fkey",
          "tableFrom": "conversations",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "conversations_customer_id_fkey": {
          "name": "conversations_customer_id_fkey",
          "tableFrom": "conversations",
          "tableTo": "customers",
          "schemaTo": "public",
          "columnsFrom": [
            "customer_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "conversations_restaurant_id_fkey": {
          "name": "conversations_restaurant_id_fkey",
          "tableFrom": "conversations",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.ai_agent_configs": {
      "name": "ai_agent_configs",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "voice_enabled": {
          "name": "voice_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "chat_enabled": {
          "name": "chat_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "model": {
          "name": "model",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'gpt-4o'"
        },
        "voice_model": {
          "name": "voice_model",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'nova'"
        },
        "response_style": {
          "name": "response_style",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'friendly'"
        },
        "system_prompt": {
          "name": "system_prompt",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "greeting_script": {
          "name": "greeting_script",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "closing_script": {
          "name": "closing_script",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "fallback_rules": {
          "name": "fallback_rules",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "capabilities": {
          "name": "capabilities",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'::jsonb"
        },
        "twilio_phone_number": {
          "name": "twilio_phone_number",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "inbound_routing": {
          "name": "inbound_routing",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'ai_agent'"
        },
        "outbound_enabled": {
          "name": "outbound_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "call_greeting": {
          "name": "call_greeting",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'Hello! Thank you for calling. I am your AI assistant. How can I help you today?'"
        },
        "call_recording_enabled": {
          "name": "call_recording_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "call_transcription_enabled": {
          "name": "call_transcription_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "ai_agent_configs_branch_id_fkey": {
          "name": "ai_agent_configs_branch_id_fkey",
          "tableFrom": "ai_agent_configs",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "ai_agent_configs_restaurant_id_fkey": {
          "name": "ai_agent_configs_restaurant_id_fkey",
          "tableFrom": "ai_agent_configs",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.knowledge_base": {
      "name": "knowledge_base",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "type": {
          "name": "type",
          "type": "kb_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'doc'"
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "url": {
          "name": "url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "question": {
          "name": "question",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "answer": {
          "name": "answer",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "file_size": {
          "name": "file_size",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "file_type": {
          "name": "file_type",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "pages": {
          "name": "pages",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'active'"
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "embedding": {
          "name": "embedding",
          "type": "vector(1536)",
          "primaryKey": false,
          "notNull": false
        },
        "embedding_status": {
          "name": "embedding_status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "embedding_error": {
          "name": "embedding_error",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "kb_embedding_idx": {
          "name": "kb_embedding_idx",
          "columns": [
            {
              "expression": "embedding",
              "asc": true,
              "nulls": "last",
              "opclass": "vector_cosine_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "ivfflat",
          "with": {
            "lists": "100"
          }
        }
      },
      "foreignKeys": {
        "knowledge_base_branch_id_fkey": {
          "name": "knowledge_base_branch_id_fkey",
          "tableFrom": "knowledge_base",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "knowledge_base_restaurant_id_fkey": {
          "name": "knowledge_base_restaurant_id_fkey",
          "tableFrom": "knowledge_base",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.staff": {
      "name": "staff",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'staff'"
        },
        "permissions": {
          "name": "permissions",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "last_active_at": {
          "name": "last_active_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "role_id": {
          "name": "role_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "staff_branch_id_fkey": {
          "name": "staff_branch_id_fkey",
          "tableFrom": "staff",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "staff_restaurant_id_fkey": {
          "name": "staff_restaurant_id_fkey",
          "tableFrom": "staff",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "staff_role_id_fkey": {
          "name": "staff_role_id_fkey",
          "tableFrom": "staff",
          "tableTo": "roles",
          "schemaTo": "public",
          "columnsFrom": [
            "role_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "staff_user_id_fkey": {
          "name": "staff_user_id_fkey",
          "tableFrom": "staff",
          "tableTo": "users",
          "schemaTo": "public",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.webhooks": {
      "name": "webhooks",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "endpoint_url": {
          "name": "endpoint_url",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "events": {
          "name": "events",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "secret": {
          "name": "secret",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'active'"
        },
        "success_rate": {
          "name": "success_rate",
          "type": "numeric(5, 2)",
          "primaryKey": false,
          "notNull": false,
          "default": "'100'"
        },
        "total_deliveries": {
          "name": "total_deliveries",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "webhooks_restaurant_id_fkey": {
          "name": "webhooks_restaurant_id_fkey",
          "tableFrom": "webhooks",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.api_keys": {
      "name": "api_keys",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "key_hash": {
          "name": "key_hash",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "key_preview": {
          "name": "key_preview",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "permissions": {
          "name": "permissions",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "calls_this_month": {
          "name": "calls_this_month",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'active'"
        },
        "last_used_at": {
          "name": "last_used_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "api_keys_restaurant_id_fkey": {
          "name": "api_keys_restaurant_id_fkey",
          "tableFrom": "api_keys",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.notifications": {
      "name": "notifications",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "type": {
          "name": "type",
          "type": "notification_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'system'"
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "message": {
          "name": "message",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "is_read": {
          "name": "is_read",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "action_label": {
          "name": "action_label",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "action_href": {
          "name": "action_href",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_notifications_is_read": {
          "name": "idx_notifications_is_read",
          "columns": [
            {
              "expression": "is_read",
              "asc": true,
              "nulls": "last",
              "opclass": "bool_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_notifications_restaurant_id": {
          "name": "idx_notifications_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_notifications_user_id": {
          "name": "idx_notifications_user_id",
          "columns": [
            {
              "expression": "user_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "notifications_restaurant_id_fkey": {
          "name": "notifications_restaurant_id_fkey",
          "tableFrom": "notifications",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "notifications_user_id_fkey": {
          "name": "notifications_user_id_fkey",
          "tableFrom": "notifications",
          "tableTo": "users",
          "schemaTo": "public",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.support_tickets": {
      "name": "support_tickets",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "subject": {
          "name": "subject",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "category": {
          "name": "category",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'Other'"
        },
        "priority": {
          "name": "priority",
          "type": "ticket_priority",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'medium'"
        },
        "status": {
          "name": "status",
          "type": "ticket_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'open'"
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "messages": {
          "name": "messages",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_support_tickets_restaurant_id": {
          "name": "idx_support_tickets_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "support_tickets_restaurant_id_fkey": {
          "name": "support_tickets_restaurant_id_fkey",
          "tableFrom": "support_tickets",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "support_tickets_user_id_fkey": {
          "name": "support_tickets_user_id_fkey",
          "tableFrom": "support_tickets",
          "tableTo": "users",
          "schemaTo": "public",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.blog_posts": {
      "name": "blog_posts",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "author_id": {
          "name": "author_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "slug": {
          "name": "slug",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "content": {
          "name": "content",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "hero_image": {
          "name": "hero_image",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "excerpt": {
          "name": "excerpt",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "category": {
          "name": "category",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'General'"
        },
        "tags": {
          "name": "tags",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "status": {
          "name": "status",
          "type": "blog_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'draft'"
        },
        "views": {
          "name": "views",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "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": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_blog_posts_slug": {
          "name": "idx_blog_posts_slug",
          "columns": [
            {
              "expression": "slug",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_blog_posts_status": {
          "name": "idx_blog_posts_status",
          "columns": [
            {
              "expression": "status",
              "asc": true,
              "nulls": "last",
              "opclass": "enum_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "blog_posts_slug_key": {
          "columns": [
            "slug"
          ],
          "nullsNotDistinct": false,
          "name": "blog_posts_slug_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.call_logs": {
      "name": "call_logs",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "conversation_id": {
          "name": "conversation_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "call_sid": {
          "name": "call_sid",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "direction": {
          "name": "direction",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'inbound'"
        },
        "from_number": {
          "name": "from_number",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "to_number": {
          "name": "to_number",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'initiated'"
        },
        "duration_seconds": {
          "name": "duration_seconds",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "transcript": {
          "name": "transcript",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "recording_url": {
          "name": "recording_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "ai_handled": {
          "name": "ai_handled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "escalated_to_human": {
          "name": "escalated_to_human",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "escalation_reason": {
          "name": "escalation_reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "started_at": {
          "name": "started_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "ended_at": {
          "name": "ended_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_call_logs_call_sid": {
          "name": "idx_call_logs_call_sid",
          "columns": [
            {
              "expression": "call_sid",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_call_logs_conversation_id": {
          "name": "idx_call_logs_conversation_id",
          "columns": [
            {
              "expression": "conversation_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_call_logs_direction": {
          "name": "idx_call_logs_direction",
          "columns": [
            {
              "expression": "direction",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_call_logs_restaurant_id": {
          "name": "idx_call_logs_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "call_logs_branch_id_fkey": {
          "name": "call_logs_branch_id_fkey",
          "tableFrom": "call_logs",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "call_logs_conversation_id_fkey": {
          "name": "call_logs_conversation_id_fkey",
          "tableFrom": "call_logs",
          "tableTo": "conversations",
          "schemaTo": "public",
          "columnsFrom": [
            "conversation_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "call_logs_restaurant_id_fkey": {
          "name": "call_logs_restaurant_id_fkey",
          "tableFrom": "call_logs",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.password_reset_tokens": {
      "name": "password_reset_tokens",
      "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
        },
        "used": {
          "name": "used",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_password_reset_tokens_token": {
          "name": "idx_password_reset_tokens_token",
          "columns": [
            {
              "expression": "token",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "password_reset_tokens_user_id_fkey": {
          "name": "password_reset_tokens_user_id_fkey",
          "tableFrom": "password_reset_tokens",
          "tableTo": "users",
          "schemaTo": "public",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "password_reset_tokens_user_id_key": {
          "columns": [
            "user_id"
          ],
          "nullsNotDistinct": false,
          "name": "password_reset_tokens_user_id_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.platform_settings": {
      "name": "platform_settings",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "key": {
          "name": "key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "value": {
          "name": "value",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'{}'::jsonb"
        },
        "updated_by": {
          "name": "updated_by",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_platform_settings_key": {
          "name": "idx_platform_settings_key",
          "columns": [
            {
              "expression": "key",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "platform_settings_key_key": {
          "columns": [
            "key"
          ],
          "nullsNotDistinct": false,
          "name": "platform_settings_key_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.notification_preferences": {
      "name": "notification_preferences",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "preferences": {
          "name": "preferences",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_notification_preferences_restaurant_id": {
          "name": "idx_notification_preferences_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_notification_preferences_user_id": {
          "name": "idx_notification_preferences_user_id",
          "columns": [
            {
              "expression": "user_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "notification_preferences_restaurant_id_fkey": {
          "name": "notification_preferences_restaurant_id_fkey",
          "tableFrom": "notification_preferences",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "notification_preferences_user_id_fkey": {
          "name": "notification_preferences_user_id_fkey",
          "tableFrom": "notification_preferences",
          "tableTo": "users",
          "schemaTo": "public",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.message_templates": {
      "name": "message_templates",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "template_key": {
          "name": "template_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "channel": {
          "name": "channel",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_message_templates_restaurant_id": {
          "name": "idx_message_templates_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "message_templates_restaurant_id_fkey": {
          "name": "message_templates_restaurant_id_fkey",
          "tableFrom": "message_templates",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "message_templates_restaurant_id_template_key_channel_key": {
          "columns": [
            "restaurant_id",
            "template_key",
            "channel"
          ],
          "nullsNotDistinct": false,
          "name": "message_templates_restaurant_id_template_key_channel_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.audit_logs": {
      "name": "audit_logs",
      "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
        },
        "actor_email": {
          "name": "actor_email",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "actor_type": {
          "name": "actor_type",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'system'"
        },
        "action": {
          "name": "action",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "resource": {
          "name": "resource",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "resource_id": {
          "name": "resource_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "ip_address": {
          "name": "ip_address",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "severity": {
          "name": "severity",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'info'"
        },
        "metadata": {
          "name": "metadata",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'::jsonb"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_audit_logs_actor_type": {
          "name": "idx_audit_logs_actor_type",
          "columns": [
            {
              "expression": "actor_type",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_audit_logs_created_at": {
          "name": "idx_audit_logs_created_at",
          "columns": [
            {
              "expression": "created_at",
              "asc": false,
              "nulls": "first",
              "opclass": "timestamptz_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_audit_logs_severity": {
          "name": "idx_audit_logs_severity",
          "columns": [
            {
              "expression": "severity",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.webhook_delivery_logs": {
      "name": "webhook_delivery_logs",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "webhook_id": {
          "name": "webhook_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "event": {
          "name": "event",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'success'"
        },
        "response_code": {
          "name": "response_code",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "duration_ms": {
          "name": "duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "error_message": {
          "name": "error_message",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "triggered_at": {
          "name": "triggered_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "response_body": {
          "name": "response_body",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "webhook_delivery_logs_restaurant_id_fkey": {
          "name": "webhook_delivery_logs_restaurant_id_fkey",
          "tableFrom": "webhook_delivery_logs",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "webhook_delivery_logs_webhook_id_fkey": {
          "name": "webhook_delivery_logs_webhook_id_fkey",
          "tableFrom": "webhook_delivery_logs",
          "tableTo": "webhooks",
          "schemaTo": "public",
          "columnsFrom": [
            "webhook_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.menu_items": {
      "name": "menu_items",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "category_id": {
          "name": "category_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "price": {
          "name": "price",
          "type": "numeric(10, 2)",
          "primaryKey": false,
          "notNull": false,
          "default": "'0'"
        },
        "modifiers": {
          "name": "modifiers",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "dietary_tags": {
          "name": "dietary_tags",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "image_url": {
          "name": "image_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "is_available": {
          "name": "is_available",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "sort_order": {
          "name": "sort_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "spice_level": {
          "name": "spice_level",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "is_veg": {
          "name": "is_veg",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "prep_time_minutes": {
          "name": "prep_time_minutes",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "calories": {
          "name": "calories",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        }
      },
      "indexes": {
        "idx_menu_items_restaurant_id": {
          "name": "idx_menu_items_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "menu_items_branch_id_fkey": {
          "name": "menu_items_branch_id_fkey",
          "tableFrom": "menu_items",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "menu_items_category_id_fkey": {
          "name": "menu_items_category_id_fkey",
          "tableFrom": "menu_items",
          "tableTo": "menu_categories",
          "schemaTo": "public",
          "columnsFrom": [
            "category_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "menu_items_restaurant_id_fkey": {
          "name": "menu_items_restaurant_id_fkey",
          "tableFrom": "menu_items",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.menu_modifier_groups": {
      "name": "menu_modifier_groups",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "menu_item_id": {
          "name": "menu_item_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'checkbox'"
        },
        "is_required": {
          "name": "is_required",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "min_selections": {
          "name": "min_selections",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "max_selections": {
          "name": "max_selections",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "display_order": {
          "name": "display_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_menu_modifier_groups_item_id": {
          "name": "idx_menu_modifier_groups_item_id",
          "columns": [
            {
              "expression": "menu_item_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_menu_modifier_groups_restaurant_id": {
          "name": "idx_menu_modifier_groups_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "menu_modifier_groups_branch_id_fkey": {
          "name": "menu_modifier_groups_branch_id_fkey",
          "tableFrom": "menu_modifier_groups",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "menu_modifier_groups_menu_item_id_fkey": {
          "name": "menu_modifier_groups_menu_item_id_fkey",
          "tableFrom": "menu_modifier_groups",
          "tableTo": "menu_items",
          "schemaTo": "public",
          "columnsFrom": [
            "menu_item_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "menu_modifier_groups_restaurant_id_fkey": {
          "name": "menu_modifier_groups_restaurant_id_fkey",
          "tableFrom": "menu_modifier_groups",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.menu_modifier_options": {
      "name": "menu_modifier_options",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "modifier_group_id": {
          "name": "modifier_group_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "price_delta": {
          "name": "price_delta",
          "type": "numeric(10, 2)",
          "primaryKey": false,
          "notNull": false,
          "default": "'0'"
        },
        "is_default": {
          "name": "is_default",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "is_available": {
          "name": "is_available",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "display_order": {
          "name": "display_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_menu_modifier_options_group_id": {
          "name": "idx_menu_modifier_options_group_id",
          "columns": [
            {
              "expression": "modifier_group_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "menu_modifier_options_modifier_group_id_fkey": {
          "name": "menu_modifier_options_modifier_group_id_fkey",
          "tableFrom": "menu_modifier_options",
          "tableTo": "menu_modifier_groups",
          "schemaTo": "public",
          "columnsFrom": [
            "modifier_group_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.llm_providers": {
      "name": "llm_providers",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "display_name": {
          "name": "display_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "api_base_url": {
          "name": "api_base_url",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "auth_header_format": {
          "name": "auth_header_format",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'Bearer'"
        },
        "api_key_env_var": {
          "name": "api_key_env_var",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "display_order": {
          "name": "display_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "llm_providers_name_key": {
          "columns": [
            "name"
          ],
          "nullsNotDistinct": false,
          "name": "llm_providers_name_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.llm_models": {
      "name": "llm_models",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "provider_id": {
          "name": "provider_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "model_id": {
          "name": "model_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "display_name": {
          "name": "display_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "context_length": {
          "name": "context_length",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 4096
        },
        "supports_functions": {
          "name": "supports_functions",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "display_order": {
          "name": "display_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_llm_models_provider_id": {
          "name": "idx_llm_models_provider_id",
          "columns": [
            {
              "expression": "provider_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "llm_models_provider_id_fkey": {
          "name": "llm_models_provider_id_fkey",
          "tableFrom": "llm_models",
          "tableTo": "llm_providers",
          "schemaTo": "public",
          "columnsFrom": [
            "provider_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "llm_models_provider_id_model_id_key": {
          "columns": [
            "provider_id",
            "model_id"
          ],
          "nullsNotDistinct": false,
          "name": "llm_models_provider_id_model_id_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.voice_providers": {
      "name": "voice_providers",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "display_name": {
          "name": "display_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "api_base_url": {
          "name": "api_base_url",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "api_key_env_var": {
          "name": "api_key_env_var",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "display_order": {
          "name": "display_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "voice_providers_name_key": {
          "columns": [
            "name"
          ],
          "nullsNotDistinct": false,
          "name": "voice_providers_name_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.voice_models": {
      "name": "voice_models",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "voice_provider_id": {
          "name": "voice_provider_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "voice_id": {
          "name": "voice_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "display_name": {
          "name": "display_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "language_code": {
          "name": "language_code",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'en-US'"
        },
        "gender": {
          "name": "gender",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'neutral'"
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "display_order": {
          "name": "display_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_voice_models_provider_id": {
          "name": "idx_voice_models_provider_id",
          "columns": [
            {
              "expression": "voice_provider_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "voice_models_voice_provider_id_fkey": {
          "name": "voice_models_voice_provider_id_fkey",
          "tableFrom": "voice_models",
          "tableTo": "voice_providers",
          "schemaTo": "public",
          "columnsFrom": [
            "voice_provider_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "voice_models_voice_provider_id_voice_id_key": {
          "columns": [
            "voice_provider_id",
            "voice_id"
          ],
          "nullsNotDistinct": false,
          "name": "voice_models_voice_provider_id_voice_id_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.restaurant_api_keys": {
      "name": "restaurant_api_keys",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "provider_name": {
          "name": "provider_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "encrypted_api_key": {
          "name": "encrypted_api_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "key_hint": {
          "name": "key_hint",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_restaurant_api_keys_restaurant": {
          "name": "idx_restaurant_api_keys_restaurant",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "restaurant_api_keys_restaurant_id_fkey": {
          "name": "restaurant_api_keys_restaurant_id_fkey",
          "tableFrom": "restaurant_api_keys",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "restaurant_api_keys_restaurant_id_provider_name_key": {
          "columns": [
            "restaurant_id",
            "provider_name"
          ],
          "nullsNotDistinct": false,
          "name": "restaurant_api_keys_restaurant_id_provider_name_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.telephone_settings": {
      "name": "telephone_settings",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "twilio_connected": {
          "name": "twilio_connected",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "twilio_account_sid_hint": {
          "name": "twilio_account_sid_hint",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "twilio_account_sid": {
          "name": "twilio_account_sid",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "twilio_auth_token": {
          "name": "twilio_auth_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "telephone_settings_restaurant_id_fkey": {
          "name": "telephone_settings_restaurant_id_fkey",
          "tableFrom": "telephone_settings",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "telephone_settings_restaurant_id_key": {
          "columns": [
            "restaurant_id"
          ],
          "nullsNotDistinct": false,
          "name": "telephone_settings_restaurant_id_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.sip_registrations": {
      "name": "sip_registrations",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "contact_uri": {
          "name": "contact_uri",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "aor": {
          "name": "aor",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true
        },
        "user_agent": {
          "name": "user_agent",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_sip_registrations_aor": {
          "name": "idx_sip_registrations_aor",
          "columns": [
            {
              "expression": "aor",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_sip_registrations_aor_contact": {
          "name": "idx_sip_registrations_aor_contact",
          "columns": [
            {
              "expression": "aor",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            },
            {
              "expression": "contact_uri",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_sip_registrations_expires": {
          "name": "idx_sip_registrations_expires",
          "columns": [
            {
              "expression": "expires_at",
              "asc": true,
              "nulls": "last",
              "opclass": "timestamptz_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_sip_registrations_restaurant": {
          "name": "idx_sip_registrations_restaurant",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "sip_registrations_restaurant_id_fkey": {
          "name": "sip_registrations_restaurant_id_fkey",
          "tableFrom": "sip_registrations",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.sip_call_sessions": {
      "name": "sip_call_sessions",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "phone_number_id": {
          "name": "phone_number_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "agent_id": {
          "name": "agent_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "sip_call_id": {
          "name": "sip_call_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "caller_number": {
          "name": "caller_number",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "callee_number": {
          "name": "callee_number",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "direction": {
          "name": "direction",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'inbound'"
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'ringing'"
        },
        "started_at": {
          "name": "started_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "ended_at": {
          "name": "ended_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "duration_seconds": {
          "name": "duration_seconds",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "transcript": {
          "name": "transcript",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "escalated_to_human": {
          "name": "escalated_to_human",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "metadata": {
          "name": "metadata",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'::jsonb"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "recording_url": {
          "name": "recording_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "idx_sip_call_sessions_restaurant": {
          "name": "idx_sip_call_sessions_restaurant",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_sip_call_sessions_started_at": {
          "name": "idx_sip_call_sessions_started_at",
          "columns": [
            {
              "expression": "started_at",
              "asc": false,
              "nulls": "first",
              "opclass": "timestamptz_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_sip_call_sessions_status": {
          "name": "idx_sip_call_sessions_status",
          "columns": [
            {
              "expression": "status",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "sip_call_sessions_agent_id_fkey": {
          "name": "sip_call_sessions_agent_id_fkey",
          "tableFrom": "sip_call_sessions",
          "tableTo": "ai_agents",
          "schemaTo": "public",
          "columnsFrom": [
            "agent_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "sip_call_sessions_phone_number_id_fkey": {
          "name": "sip_call_sessions_phone_number_id_fkey",
          "tableFrom": "sip_call_sessions",
          "tableTo": "phone_numbers",
          "schemaTo": "public",
          "columnsFrom": [
            "phone_number_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "sip_call_sessions_restaurant_id_fkey": {
          "name": "sip_call_sessions_restaurant_id_fkey",
          "tableFrom": "sip_call_sessions",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.widget_settings": {
      "name": "widget_settings",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "primary_color": {
          "name": "primary_color",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'#f97316'"
        },
        "welcome_message": {
          "name": "welcome_message",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'Hi! How can we help you today?'"
        },
        "placeholder_text": {
          "name": "placeholder_text",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'Type your message...'"
        },
        "position": {
          "name": "position",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'bottom-right'"
        },
        "auto_open_delay": {
          "name": "auto_open_delay",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "bot_name": {
          "name": "bot_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'AI Assistant'"
        },
        "show_branding": {
          "name": "show_branding",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "is_enabled": {
          "name": "is_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "agent_id": {
          "name": "agent_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "icon_url": {
          "name": "icon_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "widget_settings_agent_id_fkey": {
          "name": "widget_settings_agent_id_fkey",
          "tableFrom": "widget_settings",
          "tableTo": "ai_agents",
          "schemaTo": "public",
          "columnsFrom": [
            "agent_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "widget_settings_restaurant_id_fkey": {
          "name": "widget_settings_restaurant_id_fkey",
          "tableFrom": "widget_settings",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "widget_settings_restaurant_id_key": {
          "columns": [
            "restaurant_id"
          ],
          "nullsNotDistinct": false,
          "name": "widget_settings_restaurant_id_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.ai_agents": {
      "name": "ai_agents",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "branch_id": {
          "name": "branch_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "role": {
          "name": "role",
          "type": "agent_role",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false,
          "default": "'general'"
        },
        "llm_model_id": {
          "name": "llm_model_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "voice_model_id": {
          "name": "voice_model_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "system_prompt": {
          "name": "system_prompt",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "greeting_script": {
          "name": "greeting_script",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "closing_script": {
          "name": "closing_script",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "fallback_rules": {
          "name": "fallback_rules",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'[]'::jsonb"
        },
        "capabilities": {
          "name": "capabilities",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'::jsonb"
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "is_default": {
          "name": "is_default",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "voice_language_code": {
          "name": "voice_language_code",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'hi-IN'"
        },
        "channels": {
          "name": "channels",
          "type": "text[]",
          "primaryKey": false,
          "notNull": true,
          "default": "'{\"chat\",\"voice\"}'"
        },
        "realtime_model": {
          "name": "realtime_model",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'gpt-realtime-1.5'"
        },
        "vad_threshold": {
          "name": "vad_threshold",
          "type": "double precision",
          "primaryKey": false,
          "notNull": false,
          "default": 0.5
        },
        "vad_prefix_padding_ms": {
          "name": "vad_prefix_padding_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 300
        },
        "vad_silence_duration_ms": {
          "name": "vad_silence_duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 600
        }
      },
      "indexes": {
        "idx_ai_agents_default_per_restaurant": {
          "name": "idx_ai_agents_default_per_restaurant",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "where": "(is_default = true)",
          "with": {}
        },
        "idx_ai_agents_restaurant_id": {
          "name": "idx_ai_agents_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_ai_agents_role": {
          "name": "idx_ai_agents_role",
          "columns": [
            {
              "expression": "role",
              "asc": true,
              "nulls": "last",
              "opclass": "enum_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "ai_agents_branch_id_fkey": {
          "name": "ai_agents_branch_id_fkey",
          "tableFrom": "ai_agents",
          "tableTo": "branches",
          "schemaTo": "public",
          "columnsFrom": [
            "branch_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "ai_agents_llm_model_id_fkey": {
          "name": "ai_agents_llm_model_id_fkey",
          "tableFrom": "ai_agents",
          "tableTo": "llm_models",
          "schemaTo": "public",
          "columnsFrom": [
            "llm_model_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "ai_agents_restaurant_id_fkey": {
          "name": "ai_agents_restaurant_id_fkey",
          "tableFrom": "ai_agents",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "ai_agents_voice_model_id_fkey": {
          "name": "ai_agents_voice_model_id_fkey",
          "tableFrom": "ai_agents",
          "tableTo": "voice_models",
          "schemaTo": "public",
          "columnsFrom": [
            "voice_model_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.roles": {
      "name": "roles",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "permissions": {
          "name": "permissions",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true,
          "default": "'{}'::jsonb"
        },
        "is_system": {
          "name": "is_system",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_roles_restaurant_id": {
          "name": "idx_roles_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_roles_restaurant_name": {
          "name": "idx_roles_restaurant_name",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            },
            {
              "expression": "name",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "roles_restaurant_id_fkey": {
          "name": "roles_restaurant_id_fkey",
          "tableFrom": "roles",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.alert_settings": {
      "name": "alert_settings",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "restaurant_id": {
          "name": "restaurant_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "sound_enabled": {
          "name": "sound_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "volume": {
          "name": "volume",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 70
        },
        "auto_dismiss": {
          "name": "auto_dismiss",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 30
        },
        "show_orders": {
          "name": "show_orders",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "show_bookings": {
          "name": "show_bookings",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "show_ai_escalations": {
          "name": "show_ai_escalations",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "browser_notifications": {
          "name": "browser_notifications",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_alert_settings_restaurant_id": {
          "name": "idx_alert_settings_restaurant_id",
          "columns": [
            {
              "expression": "restaurant_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "alert_settings_restaurant_id_fkey": {
          "name": "alert_settings_restaurant_id_fkey",
          "tableFrom": "alert_settings",
          "tableTo": "restaurants",
          "schemaTo": "public",
          "columnsFrom": [
            "restaurant_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "alert_settings_restaurant_unique": {
          "columns": [
            "restaurant_id"
          ],
          "nullsNotDistinct": false,
          "name": "alert_settings_restaurant_unique"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.languages": {
      "name": "languages",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "code": {
          "name": "code",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "native_name": {
          "name": "native_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "flag_emoji": {
          "name": "flag_emoji",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "''"
        },
        "is_rtl": {
          "name": "is_rtl",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "is_default": {
          "name": "is_default",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "display_order": {
          "name": "display_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_languages_code": {
          "name": "idx_languages_code",
          "columns": [
            {
              "expression": "code",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_languages_is_active": {
          "name": "idx_languages_is_active",
          "columns": [
            {
              "expression": "is_active",
              "asc": true,
              "nulls": "last",
              "opclass": "bool_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "languages_code_key": {
          "columns": [
            "code"
          ],
          "nullsNotDistinct": false,
          "name": "languages_code_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.translations": {
      "name": "translations",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "lang_code": {
          "name": "lang_code",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "key_id": {
          "name": "key_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "value": {
          "name": "value",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "''"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_translations_key_id": {
          "name": "idx_translations_key_id",
          "columns": [
            {
              "expression": "key_id",
              "asc": true,
              "nulls": "last",
              "opclass": "uuid_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_translations_lang_code": {
          "name": "idx_translations_lang_code",
          "columns": [
            {
              "expression": "lang_code",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "translations_key_id_fkey": {
          "name": "translations_key_id_fkey",
          "tableFrom": "translations",
          "tableTo": "translation_keys",
          "schemaTo": "public",
          "columnsFrom": [
            "key_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "translations_lang_code_fkey": {
          "name": "translations_lang_code_fkey",
          "tableFrom": "translations",
          "tableTo": "languages",
          "schemaTo": "public",
          "columnsFrom": [
            "lang_code"
          ],
          "columnsTo": [
            "code"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "translations_lang_code_key_id_key": {
          "columns": [
            "lang_code",
            "key_id"
          ],
          "nullsNotDistinct": false,
          "name": "translations_lang_code_key_id_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.translation_keys": {
      "name": "translation_keys",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "key": {
          "name": "key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "category": {
          "name": "category",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'common'"
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "default_value": {
          "name": "default_value",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "''"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {
        "idx_translation_keys_category": {
          "name": "idx_translation_keys_category",
          "columns": [
            {
              "expression": "category",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_translation_keys_key": {
          "name": "idx_translation_keys_key",
          "columns": [
            {
              "expression": "key",
              "asc": true,
              "nulls": "last",
              "opclass": "text_ops",
              "isExpression": false
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "translation_keys_key_key": {
          "columns": [
            "key"
          ],
          "nullsNotDistinct": false,
          "name": "translation_keys_key_key"
        }
      },
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    },
    "public.agent_knowledge_bases": {
      "name": "agent_knowledge_bases",
      "schema": "",
      "columns": {
        "agent_id": {
          "name": "agent_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "kb_id": {
          "name": "kb_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "agent_knowledge_bases_agent_id_fkey": {
          "name": "agent_knowledge_bases_agent_id_fkey",
          "tableFrom": "agent_knowledge_bases",
          "tableTo": "ai_agents",
          "schemaTo": "public",
          "columnsFrom": [
            "agent_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "agent_knowledge_bases_kb_id_fkey": {
          "name": "agent_knowledge_bases_kb_id_fkey",
          "tableFrom": "agent_knowledge_bases",
          "tableTo": "knowledge_base",
          "schemaTo": "public",
          "columnsFrom": [
            "kb_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "agent_knowledge_bases_pkey": {
          "name": "agent_knowledge_bases_pkey",
          "columns": [
            "agent_id",
            "kb_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraints": {},
      "policies": {},
      "isRLSEnabled": false
    }
  },
  "enums": {
    "public.admin_role": {
      "name": "admin_role",
      "values": [
        "superadmin",
        "support"
      ],
      "schema": "public"
    },
    "public.agent_role": {
      "name": "agent_role",
      "values": [
        "orders",
        "reservations",
        "campaigns",
        "voice",
        "chat",
        "general"
      ],
      "schema": "public"
    },
    "public.blog_status": {
      "name": "blog_status",
      "values": [
        "draft",
        "published",
        "scheduled",
        "archived"
      ],
      "schema": "public"
    },
    "public.booking_status": {
      "name": "booking_status",
      "values": [
        "pending",
        "confirmed",
        "seated",
        "completed",
        "cancelled",
        "noshow",
        "escalated",
        "reminder_sent"
      ],
      "schema": "public"
    },
    "public.channel_type": {
      "name": "channel_type",
      "values": [
        "chat",
        "voice",
        "whatsapp",
        "email",
        "sms"
      ],
      "schema": "public"
    },
    "public.conversation_status": {
      "name": "conversation_status",
      "values": [
        "ai",
        "human",
        "resolved"
      ],
      "schema": "public"
    },
    "public.kb_type": {
      "name": "kb_type",
      "values": [
        "doc",
        "url",
        "qa",
        "article"
      ],
      "schema": "public"
    },
    "public.notification_type": {
      "name": "notification_type",
      "values": [
        "order",
        "booking",
        "ai",
        "system",
        "billing",
        "staff"
      ],
      "schema": "public"
    },
    "public.order_status": {
      "name": "order_status",
      "values": [
        "pending",
        "confirmed",
        "kitchen",
        "ready",
        "delivered",
        "completed",
        "cancelled",
        "failed",
        "escalated",
        "processing",
        "rider"
      ],
      "schema": "public"
    },
    "public.phone_type": {
      "name": "phone_type",
      "values": [
        "purchased",
        "sip"
      ],
      "schema": "public"
    },
    "public.plan_status": {
      "name": "plan_status",
      "values": [
        "active",
        "inactive",
        "trial",
        "cancelled",
        "past_due"
      ],
      "schema": "public"
    },
    "public.ticket_priority": {
      "name": "ticket_priority",
      "values": [
        "low",
        "medium",
        "high",
        "urgent"
      ],
      "schema": "public"
    },
    "public.ticket_status": {
      "name": "ticket_status",
      "values": [
        "open",
        "in_progress",
        "resolved",
        "closed"
      ],
      "schema": "public"
    },
    "public.user_role": {
      "name": "user_role",
      "values": [
        "owner",
        "manager",
        "staff",
        "superadmin",
        "support"
      ],
      "schema": "public"
    }
  },
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "schemas": {},
    "tables": {},
    "columns": {}
  },
  "internal": {
    "tables": {
      "ai_agents": {
        "columns": {
          "channels": {
            "isArray": true,
            "dimensions": 1,
            "rawType": "text"
          }
        }
      }
    }
  }
}