{
  "id": "204db33d-42d0-4f86-9aaf-818bebec5e10",
  "prevId": "d7f9a8ea-f8b4-42f7-89b1-5c24c822b28f",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.admin_sessions": {
      "name": "admin_sessions",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "admin_id": {
          "name": "admin_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "session_token": {
          "name": "session_token",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "expires": {
          "name": "expires",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "admin_sessions_session_token_unique": {
          "name": "admin_sessions_session_token_unique",
          "nullsNotDistinct": false,
          "columns": [
            "session_token"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.admins": {
      "name": "admins",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "username": {
          "name": "username",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true
        },
        "password_hash": {
          "name": "password_hash",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": false,
          "default": "'admin'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        },
        "last_login": {
          "name": "last_login",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "admins_username_unique": {
          "name": "admins_username_unique",
          "nullsNotDistinct": false,
          "columns": [
            "username"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {
        "admins_role_check": {
          "name": "admins_role_check",
          "value": "(role)::text = ANY (ARRAY['super_admin','admin','support'])"
        }
      },
      "isRLSEnabled": false
    },
    "public.password_resets": {
      "name": "password_resets",
      "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_at": {
          "name": "used_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "password_resets_token_unique": {
          "name": "password_resets_token_unique",
          "nullsNotDistinct": false,
          "columns": [
            "token"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.member_profiles": {
      "name": "member_profiles",
      "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
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "slug": {
          "name": "slug",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "display_name": {
          "name": "display_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "bio": {
          "name": "bio",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "avatar_url": {
          "name": "avatar_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "is_public": {
          "name": "is_public",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "member_profiles_slug_idx": {
          "name": "member_profiles_slug_idx",
          "columns": [
            {
              "expression": "slug",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "member_profiles_user_id_unique": {
          "name": "member_profiles_user_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "user_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.product_clicks": {
      "name": "product_clicks",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "product_id": {
          "name": "product_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "clicked_at": {
          "name": "clicked_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "referrer": {
          "name": "referrer",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "ip_hash": {
          "name": "ip_hash",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "product_clicks_product_idx": {
          "name": "product_clicks_product_idx",
          "columns": [
            {
              "expression": "product_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "clicked_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.recommended_products": {
      "name": "recommended_products",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "profile_id": {
          "name": "profile_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "url": {
          "name": "url",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "image_url": {
          "name": "image_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "category": {
          "name": "category",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'general'"
        },
        "display_order": {
          "name": "display_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "recommended_products_profile_idx": {
          "name": "recommended_products_profile_idx",
          "columns": [
            {
              "expression": "profile_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "display_order",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.ai_usage": {
      "name": "ai_usage",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "intent": {
          "name": "intent",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "model_used": {
          "name": "model_used",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "prompt_tokens": {
          "name": "prompt_tokens",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "completion_tokens": {
          "name": "completion_tokens",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "total_tokens": {
          "name": "total_tokens",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "cost_estimate_paise": {
          "name": "cost_estimate_paise",
          "type": "numeric(10, 4)",
          "primaryKey": false,
          "notNull": false
        },
        "duration_ms": {
          "name": "duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "ai_usage_created_idx": {
          "name": "ai_usage_created_idx",
          "columns": [
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "ai_usage_family_idx": {
          "name": "ai_usage_family_idx",
          "columns": [
            {
              "expression": "family_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.chat_messages": {
      "name": "chat_messages",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "session_id": {
          "name": "session_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "varchar(20)",
          "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()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.chat_sessions": {
      "name": "chat_sessions",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "default": "'New conversation'"
        },
        "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": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.audit_log": {
      "name": "audit_log",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "action": {
          "name": "action",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true
        },
        "resource_type": {
          "name": "resource_type",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false
        },
        "resource_id": {
          "name": "resource_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "ip_address": {
          "name": "ip_address",
          "type": "varchar(45)",
          "primaryKey": false,
          "notNull": false
        },
        "user_agent": {
          "name": "user_agent",
          "type": "text",
          "primaryKey": false,
          "notNull": 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": true,
          "default": "now()"
        }
      },
      "indexes": {
        "audit_family_idx": {
          "name": "audit_family_idx",
          "columns": [
            {
              "expression": "family_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_audit_log_action": {
          "name": "idx_audit_log_action",
          "columns": [
            {
              "expression": "action",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_audit_log_created": {
          "name": "idx_audit_log_created",
          "columns": [
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_audit_log_family": {
          "name": "idx_audit_log_family",
          "columns": [
            {
              "expression": "family_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "idx_audit_log_user": {
          "name": "idx_audit_log_user",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.log_corrections": {
      "name": "log_corrections",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "dose_id": {
          "name": "dose_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "original_value": {
          "name": "original_value",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "corrected_value": {
          "name": "corrected_value",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "reason": {
          "name": "reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "corrected_by": {
          "name": "corrected_by",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "log_corrections_dose_idx": {
          "name": "log_corrections_dose_idx",
          "columns": [
            {
              "expression": "dose_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.accounts": {
      "name": "accounts",
      "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
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "provider": {
          "name": "provider",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "provider_account_id": {
          "name": "provider_account_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "refresh_token": {
          "name": "refresh_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "access_token": {
          "name": "access_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "token_type": {
          "name": "token_type",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "scope": {
          "name": "scope",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "id_token": {
          "name": "id_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "session_state": {
          "name": "session_state",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "accounts_provider_idx": {
          "name": "accounts_provider_idx",
          "columns": [
            {
              "expression": "provider",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "provider_account_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sessions": {
      "name": "sessions",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "session_token": {
          "name": "session_token",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "expires": {
          "name": "expires",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "sessions_session_token_unique": {
          "name": "sessions_session_token_unique",
          "nullsNotDistinct": false,
          "columns": [
            "session_token"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.users": {
      "name": "users",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email_verified": {
          "name": "email_verified",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "image": {
          "name": "image",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "password_hash": {
          "name": "password_hash",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false
        },
        "password_updated_at": {
          "name": "password_updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "users_email_unique": {
          "name": "users_email_unique",
          "nullsNotDistinct": false,
          "columns": [
            "email"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.verification_tokens": {
      "name": "verification_tokens",
      "schema": "",
      "columns": {
        "identifier": {
          "name": "identifier",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "token": {
          "name": "token",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "expires": {
          "name": "expires",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "verification_tokens_idx": {
          "name": "verification_tokens_idx",
          "columns": [
            {
              "expression": "identifier",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "token",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.children": {
      "name": "children",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "birth_date": {
          "name": "birth_date",
          "type": "date",
          "primaryKey": false,
          "notNull": true
        },
        "sex": {
          "name": "sex",
          "type": "child_sex",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false
        },
        "stage": {
          "name": "stage",
          "type": "child_stage",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'newborn'"
        },
        "image_url": {
          "name": "image_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "children_family_idx": {
          "name": "children_family_idx",
          "columns": [
            {
              "expression": "family_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.families": {
      "name": "families",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "tier": {
          "name": "tier",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": false,
          "default": "'free'"
        },
        "max_children": {
          "name": "max_children",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 1
        },
        "max_members": {
          "name": "max_members",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 2
        },
        "pediatrician_phone": {
          "name": "pediatrician_phone",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.family_invites": {
      "name": "family_invites",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "member_role",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'viewer'"
        },
        "token": {
          "name": "token",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "invite_token_idx": {
          "name": "invite_token_idx",
          "columns": [
            {
              "expression": "token",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "family_invites_token_unique": {
          "name": "family_invites_token_unique",
          "nullsNotDistinct": false,
          "columns": [
            "token"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.family_members": {
      "name": "family_members",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "member_role",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'caregiver'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "family_members_family_id_user_id_key": {
          "name": "family_members_family_id_user_id_key",
          "columns": [
            {
              "expression": "family_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.attachments": {
      "name": "attachments",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "log_entry_id": {
          "name": "log_entry_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "r2_key": {
          "name": "r2_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "r2_thumbnail_key": {
          "name": "r2_thumbnail_key",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "mime_type": {
          "name": "mime_type",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "size_bytes": {
          "name": "size_bytes",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "uploaded_by": {
          "name": "uploaded_by",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "attachments_family_idx": {
          "name": "attachments_family_idx",
          "columns": [
            {
              "expression": "family_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.memories": {
      "name": "memories",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "taken_at": {
          "name": "taken_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "r2_key": {
          "name": "r2_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "r2_thumbnail_key": {
          "name": "r2_thumbnail_key",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "mime_type": {
          "name": "mime_type",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "size_bytes": {
          "name": "size_bytes",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "width": {
          "name": "width",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "height": {
          "name": "height",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "vision_caption": {
          "name": "vision_caption",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "vision_tags": {
          "name": "vision_tags",
          "type": "text[]",
          "primaryKey": false,
          "notNull": false
        },
        "vision_embedding": {
          "name": "vision_embedding",
          "type": "vector(1536)",
          "primaryKey": false,
          "notNull": false
        },
        "is_private": {
          "name": "is_private",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "processing_status": {
          "name": "processing_status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'uploading'"
        },
        "uploaded_by": {
          "name": "uploaded_by",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "memories_family_idx": {
          "name": "memories_family_idx",
          "columns": [
            {
              "expression": "family_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "memories_child_idx": {
          "name": "memories_child_idx",
          "columns": [
            {
              "expression": "child_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "memories_embedding_idx": {
          "name": "memories_embedding_idx",
          "columns": [
            {
              "expression": "vision_embedding",
              "isExpression": false,
              "asc": true,
              "nulls": "last",
              "opclass": "vector_cosine_ops"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "ivfflat",
          "with": {
            "lists": 100
          }
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.diapers_logs": {
      "name": "diapers_logs",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "diaper_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "logged_at": {
          "name": "logged_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "diapers_logs_child_id_children_id_fk": {
          "name": "diapers_logs_child_id_children_id_fk",
          "tableFrom": "diapers_logs",
          "tableTo": "children",
          "columnsFrom": [
            "child_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.feeds": {
      "name": "feeds",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "feed_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "method": {
          "name": "method",
          "type": "feed_method",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": false
        },
        "amount_ml": {
          "name": "amount_ml",
          "type": "real",
          "primaryKey": false,
          "notNull": false
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "logged_at": {
          "name": "logged_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "feeds_child_id_children_id_fk": {
          "name": "feeds_child_id_children_id_fk",
          "tableFrom": "feeds",
          "tableTo": "children",
          "columnsFrom": [
            "child_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.growth": {
      "name": "growth",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "measured_at": {
          "name": "measured_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "weight_kg": {
          "name": "weight_kg",
          "type": "real",
          "primaryKey": false,
          "notNull": false
        },
        "height_cm": {
          "name": "height_cm",
          "type": "real",
          "primaryKey": false,
          "notNull": false
        },
        "head_circumference_cm": {
          "name": "head_circumference_cm",
          "type": "real",
          "primaryKey": false,
          "notNull": false
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "growth_child_id_children_id_fk": {
          "name": "growth_child_id_children_id_fk",
          "tableFrom": "growth",
          "tableTo": "children",
          "columnsFrom": [
            "child_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.medications": {
      "name": "medications",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "dosage": {
          "name": "dosage",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "frequency": {
          "name": "frequency",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "start_date": {
          "name": "start_date",
          "type": "date",
          "primaryKey": false,
          "notNull": true
        },
        "end_date": {
          "name": "end_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false
        },
        "active": {
          "name": "active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "medications_child_id_children_id_fk": {
          "name": "medications_child_id_children_id_fk",
          "tableFrom": "medications",
          "tableTo": "children",
          "columnsFrom": [
            "child_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.milestone_achievements": {
      "name": "milestone_achievements",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "milestone_key": {
          "name": "milestone_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "achieved_at": {
          "name": "achieved_at",
          "type": "date",
          "primaryKey": false,
          "notNull": true
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "milestone_child_idx": {
          "name": "milestone_child_idx",
          "columns": [
            {
              "expression": "child_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "milestone_achievements_child_milestone_unique": {
          "name": "milestone_achievements_child_milestone_unique",
          "columns": [
            {
              "expression": "child_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "milestone_key",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sleeps": {
      "name": "sleeps",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "sleep_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "started_at": {
          "name": "started_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "ended_at": {
          "name": "ended_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "duration_minutes": {
          "name": "duration_minutes",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "logged_at": {
          "name": "logged_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "sleeps_child_id_children_id_fk": {
          "name": "sleeps_child_id_children_id_fk",
          "tableFrom": "sleeps",
          "tableTo": "children",
          "columnsFrom": [
            "child_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.vaccinations": {
      "name": "vaccinations",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "vaccine_name": {
          "name": "vaccine_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "scheduled_date": {
          "name": "scheduled_date",
          "type": "date",
          "primaryKey": false,
          "notNull": true
        },
        "given_date": {
          "name": "given_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "provider": {
          "name": "provider",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "lot_number": {
          "name": "lot_number",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "vaccinations_child_id_children_id_fk": {
          "name": "vaccinations_child_id_children_id_fk",
          "tableFrom": "vaccinations",
          "tableTo": "children",
          "columnsFrom": [
            "child_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.allergies": {
      "name": "allergies",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "severity": {
          "name": "severity",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "default": "'mild'"
        },
        "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": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.doctor_visits": {
      "name": "doctor_visits",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "doctor_name": {
          "name": "doctor_name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "reason": {
          "name": "reason",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false
        },
        "visit_date": {
          "name": "visit_date",
          "type": "date",
          "primaryKey": false,
          "notNull": true
        },
        "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": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.illness_logs": {
      "name": "illness_logs",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "start_date": {
          "name": "start_date",
          "type": "date",
          "primaryKey": false,
          "notNull": true
        },
        "end_date": {
          "name": "end_date",
          "type": "date",
          "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": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.medication_doses": {
      "name": "medication_doses",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "medicine_id": {
          "name": "medicine_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "administered_at": {
          "name": "administered_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "administered_by": {
          "name": "administered_by",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "amount_given": {
          "name": "amount_given",
          "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": true,
          "default": "now()"
        }
      },
      "indexes": {
        "medication_doses_family_idx": {
          "name": "medication_doses_family_idx",
          "columns": [
            {
              "expression": "family_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "medication_doses_medicine_idx": {
          "name": "medication_doses_medicine_idx",
          "columns": [
            {
              "expression": "medicine_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.medicines": {
      "name": "medicines",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "dose": {
          "name": "dose",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "reminder_time": {
          "name": "reminder_time",
          "type": "varchar(10)",
          "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": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.support_responses": {
      "name": "support_responses",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "ticket_id": {
          "name": "ticket_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "admin_id": {
          "name": "admin_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "message": {
          "name": "message",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.support_tickets": {
      "name": "support_tickets",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "email": {
          "name": "email",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "subject": {
          "name": "subject",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": false,
          "default": "'open'"
        },
        "priority": {
          "name": "priority",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": false,
          "default": "'normal'"
        },
        "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": {},
      "policies": {},
      "checkConstraints": {
        "support_tickets_status_check": {
          "name": "support_tickets_status_check",
          "value": "(status)::text = ANY (ARRAY['open','in_progress','resolved','closed'])"
        },
        "support_tickets_priority_check": {
          "name": "support_tickets_priority_check",
          "value": "(priority)::text = ANY (ARRAY['low','normal','high','urgent'])"
        }
      },
      "isRLSEnabled": false
    },
    "public.garment_wears": {
      "name": "garment_wears",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "garment_id": {
          "name": "garment_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "worn_on": {
          "name": "worn_on",
          "type": "date",
          "primaryKey": false,
          "notNull": true
        },
        "memory_id": {
          "name": "memory_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "garment_wears_garment_idx": {
          "name": "garment_wears_garment_idx",
          "columns": [
            {
              "expression": "garment_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "garment_wears_family_idx": {
          "name": "garment_wears_family_idx",
          "columns": [
            {
              "expression": "family_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "garment_wears_family_id_families_id_fk": {
          "name": "garment_wears_family_id_families_id_fk",
          "tableFrom": "garment_wears",
          "tableTo": "families",
          "columnsFrom": [
            "family_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "garment_wears_garment_id_garments_id_fk": {
          "name": "garment_wears_garment_id_garments_id_fk",
          "tableFrom": "garment_wears",
          "tableTo": "garments",
          "columnsFrom": [
            "garment_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "garment_wears_memory_id_memories_id_fk": {
          "name": "garment_wears_memory_id_memories_id_fk",
          "tableFrom": "garment_wears",
          "tableTo": "memories",
          "columnsFrom": [
            "memory_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.garments": {
      "name": "garments",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "family_id": {
          "name": "family_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "child_id": {
          "name": "child_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "category": {
          "name": "category",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "size_label": {
          "name": "size_label",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "colors": {
          "name": "colors",
          "type": "text[]",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'"
        },
        "seasons": {
          "name": "seasons",
          "type": "text[]",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'"
        },
        "occasion_tags": {
          "name": "occasion_tags",
          "type": "text[]",
          "primaryKey": false,
          "notNull": false,
          "default": "'{}'"
        },
        "image_key": {
          "name": "image_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "thumb_key": {
          "name": "thumb_key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'active'"
        },
        "acquired_via": {
          "name": "acquired_via",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "gift_from": {
          "name": "gift_from",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "vision_metadata": {
          "name": "vision_metadata",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "garments_family_idx": {
          "name": "garments_family_idx",
          "columns": [
            {
              "expression": "family_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "garments_child_idx": {
          "name": "garments_child_idx",
          "columns": [
            {
              "expression": "child_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "garments_status_idx": {
          "name": "garments_status_idx",
          "columns": [
            {
              "expression": "status",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "garments_family_id_families_id_fk": {
          "name": "garments_family_id_families_id_fk",
          "tableFrom": "garments",
          "tableTo": "families",
          "columnsFrom": [
            "family_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "garments_child_id_children_id_fk": {
          "name": "garments_child_id_children_id_fk",
          "tableFrom": "garments",
          "tableTo": "children",
          "columnsFrom": [
            "child_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {
    "public.child_sex": {
      "name": "child_sex",
      "schema": "public",
      "values": [
        "male",
        "female",
        "other"
      ]
    },
    "public.child_stage": {
      "name": "child_stage",
      "schema": "public",
      "values": [
        "newborn",
        "infant",
        "solids_start",
        "toddler_early",
        "toddler_late",
        "preschool"
      ]
    },
    "public.member_role": {
      "name": "member_role",
      "schema": "public",
      "values": [
        "admin",
        "caregiver",
        "viewer"
      ]
    },
    "public.diaper_type": {
      "name": "diaper_type",
      "schema": "public",
      "values": [
        "wet",
        "dirty",
        "both",
        "dry"
      ]
    },
    "public.feed_method": {
      "name": "feed_method",
      "schema": "public",
      "values": [
        "bottle",
        "breast_left",
        "breast_right",
        "breast_both",
        "cup",
        "spoon",
        "finger",
        "self"
      ]
    },
    "public.feed_type": {
      "name": "feed_type",
      "schema": "public",
      "values": [
        "breast_milk",
        "formula",
        "solid",
        "water",
        "other"
      ]
    },
    "public.sleep_type": {
      "name": "sleep_type",
      "schema": "public",
      "values": [
        "nap",
        "night"
      ]
    }
  },
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}