{
  "id": "16c16359-fd47-421b-9e7e-fb4a060bbfed",
  "prevId": "4ae34b1b-c6c5-42ff-a464-8064c7b558dd",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.accounts": {
      "name": "accounts",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "account_id": {
          "name": "account_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "provider_id": {
          "name": "provider_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "access_token": {
          "name": "access_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "refresh_token": {
          "name": "refresh_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "id_token": {
          "name": "id_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "access_token_expires_at": {
          "name": "access_token_expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "refresh_token_expires_at": {
          "name": "refresh_token_expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "scope": {
          "name": "scope",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "password": {
          "name": "password",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "accounts_userId_idx": {
          "name": "accounts_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "accounts_user_id_users_id_fk": {
          "name": "accounts_user_id_users_id_fk",
          "tableFrom": "accounts",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.apikeys": {
      "name": "apikeys",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "config_id": {
          "name": "config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'default'"
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "start": {
          "name": "start",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "reference_id": {
          "name": "reference_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "prefix": {
          "name": "prefix",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "key": {
          "name": "key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "refill_interval": {
          "name": "refill_interval",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "refill_amount": {
          "name": "refill_amount",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "last_refill_at": {
          "name": "last_refill_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "enabled": {
          "name": "enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "rate_limit_enabled": {
          "name": "rate_limit_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": true
        },
        "rate_limit_time_window": {
          "name": "rate_limit_time_window",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 86400000
        },
        "rate_limit_max": {
          "name": "rate_limit_max",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 10
        },
        "request_count": {
          "name": "request_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "remaining": {
          "name": "remaining",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "last_request": {
          "name": "last_request",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "permissions": {
          "name": "permissions",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "metadata": {
          "name": "metadata",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "apikeys_configId_idx": {
          "name": "apikeys_configId_idx",
          "columns": [
            {
              "expression": "config_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "apikeys_referenceId_idx": {
          "name": "apikeys_referenceId_idx",
          "columns": [
            {
              "expression": "reference_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "apikeys_key_idx": {
          "name": "apikeys_key_idx",
          "columns": [
            {
              "expression": "key",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.invitations": {
      "name": "invitations",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "team_id": {
          "name": "team_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "inviter_id": {
          "name": "inviter_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "invitations_organizationId_idx": {
          "name": "invitations_organizationId_idx",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "invitations_email_idx": {
          "name": "invitations_email_idx",
          "columns": [
            {
              "expression": "email",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "invitations_organization_id_organizations_id_fk": {
          "name": "invitations_organization_id_organizations_id_fk",
          "tableFrom": "invitations",
          "tableTo": "organizations",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "invitations_inviter_id_users_id_fk": {
          "name": "invitations_inviter_id_users_id_fk",
          "tableFrom": "invitations",
          "tableTo": "users",
          "columnsFrom": [
            "inviter_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.members": {
      "name": "members",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'member'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "members_organizationId_idx": {
          "name": "members_organizationId_idx",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "members_userId_idx": {
          "name": "members_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "members_organization_id_organizations_id_fk": {
          "name": "members_organization_id_organizations_id_fk",
          "tableFrom": "members",
          "tableTo": "organizations",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "members_user_id_users_id_fk": {
          "name": "members_user_id_users_id_fk",
          "tableFrom": "members",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.organizations": {
      "name": "organizations",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "slug": {
          "name": "slug",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "logo": {
          "name": "logo",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "metadata": {
          "name": "metadata",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "organizations_slug_uidx": {
          "name": "organizations_slug_uidx",
          "columns": [
            {
              "expression": "slug",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "organizations_slug_unique": {
          "name": "organizations_slug_unique",
          "nullsNotDistinct": false,
          "columns": [
            "slug"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sessions": {
      "name": "sessions",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "token": {
          "name": "token",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "ip_address": {
          "name": "ip_address",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "user_agent": {
          "name": "user_agent",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "active_organization_id": {
          "name": "active_organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "active_team_id": {
          "name": "active_team_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "sessions_userId_idx": {
          "name": "sessions_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "sessions_user_id_users_id_fk": {
          "name": "sessions_user_id_users_id_fk",
          "tableFrom": "sessions",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "sessions_token_unique": {
          "name": "sessions_token_unique",
          "nullsNotDistinct": false,
          "columns": [
            "token"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.team_members": {
      "name": "team_members",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "team_id": {
          "name": "team_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "teamMembers_teamId_idx": {
          "name": "teamMembers_teamId_idx",
          "columns": [
            {
              "expression": "team_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "teamMembers_userId_idx": {
          "name": "teamMembers_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "team_members_team_id_teams_id_fk": {
          "name": "team_members_team_id_teams_id_fk",
          "tableFrom": "team_members",
          "tableTo": "teams",
          "columnsFrom": [
            "team_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "team_members_user_id_users_id_fk": {
          "name": "team_members_user_id_users_id_fk",
          "tableFrom": "team_members",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.teams": {
      "name": "teams",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "teams_organizationId_idx": {
          "name": "teams_organizationId_idx",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "teams_organization_id_organizations_id_fk": {
          "name": "teams_organization_id_organizations_id_fk",
          "tableFrom": "teams",
          "tableTo": "organizations",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.users": {
      "name": "users",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email_verified": {
          "name": "email_verified",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "image": {
          "name": "image",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "users_email_unique": {
          "name": "users_email_unique",
          "nullsNotDistinct": false,
          "columns": [
            "email"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.verifications": {
      "name": "verifications",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "identifier": {
          "name": "identifier",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "value": {
          "name": "value",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "expires_at": {
          "name": "expires_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "verifications_identifier_idx": {
          "name": "verifications_identifier_idx",
          "columns": [
            {
              "expression": "identifier",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.expense_categories": {
      "name": "expense_categories",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "color": {
          "name": "color",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "is_archived": {
          "name": "is_archived",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "default": false
        },
        "sort_order": {
          "name": "sort_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "default": 0
        },
        "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": {
        "expense_categories_organization_id_organizations_id_fk": {
          "name": "expense_categories_organization_id_organizations_id_fk",
          "tableFrom": "expense_categories",
          "tableTo": "organizations",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.expenses": {
      "name": "expenses",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "member_id": {
          "name": "member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "category_id": {
          "name": "category_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "milestone_id": {
          "name": "milestone_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "amount_cents": {
          "name": "amount_cents",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "currency": {
          "name": "currency",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'USD'"
        },
        "date": {
          "name": "date",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "billable": {
          "name": "billable",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "status": {
          "name": "status",
          "type": "status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'draft'"
        },
        "reject_reason": {
          "name": "reject_reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "receipt_media_id": {
          "name": "receipt_media_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "invoice_id": {
          "name": "invoice_id",
          "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": {
        "expenses_project_id_status_idx": {
          "name": "expenses_project_id_status_idx",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "status",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "expenses_member_id_idx": {
          "name": "expenses_member_id_idx",
          "columns": [
            {
              "expression": "member_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "expenses_project_id_projects_id_fk": {
          "name": "expenses_project_id_projects_id_fk",
          "tableFrom": "expenses",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "expenses_member_id_members_id_fk": {
          "name": "expenses_member_id_members_id_fk",
          "tableFrom": "expenses",
          "tableTo": "members",
          "columnsFrom": [
            "member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "expenses_category_id_expense_categories_id_fk": {
          "name": "expenses_category_id_expense_categories_id_fk",
          "tableFrom": "expenses",
          "tableTo": "expense_categories",
          "columnsFrom": [
            "category_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "expenses_milestone_id_milestones_id_fk": {
          "name": "expenses_milestone_id_milestones_id_fk",
          "tableFrom": "expenses",
          "tableTo": "milestones",
          "columnsFrom": [
            "milestone_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "expenses_receipt_media_id_media_id_fk": {
          "name": "expenses_receipt_media_id_media_id_fk",
          "tableFrom": "expenses",
          "tableTo": "media",
          "columnsFrom": [
            "receipt_media_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "expenses_invoice_id_invoices_id_fk": {
          "name": "expenses_invoice_id_invoices_id_fk",
          "tableFrom": "expenses",
          "tableTo": "invoices",
          "columnsFrom": [
            "invoice_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.invoice_items": {
      "name": "invoice_items",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "invoice_id": {
          "name": "invoice_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "quantity": {
          "name": "quantity",
          "type": "numeric(10, 4)",
          "primaryKey": false,
          "notNull": true
        },
        "unit_price": {
          "name": "unit_price",
          "type": "numeric(16, 4)",
          "primaryKey": false,
          "notNull": true
        },
        "amount": {
          "name": "amount",
          "type": "numeric(16, 4)",
          "primaryKey": false,
          "notNull": true
        },
        "sort_order": {
          "name": "sort_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        }
      },
      "indexes": {},
      "foreignKeys": {
        "invoice_items_invoice_id_invoices_id_fk": {
          "name": "invoice_items_invoice_id_invoices_id_fk",
          "tableFrom": "invoice_items",
          "tableTo": "invoices",
          "columnsFrom": [
            "invoice_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.invoice_recipients": {
      "name": "invoice_recipients",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "invoice_id": {
          "name": "invoice_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "client_member_id": {
          "name": "client_member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "invoice_recipients_invoice_id_invoices_id_fk": {
          "name": "invoice_recipients_invoice_id_invoices_id_fk",
          "tableFrom": "invoice_recipients",
          "tableTo": "invoices",
          "columnsFrom": [
            "invoice_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "invoice_recipients_client_member_id_members_id_fk": {
          "name": "invoice_recipients_client_member_id_members_id_fk",
          "tableFrom": "invoice_recipients",
          "tableTo": "members",
          "columnsFrom": [
            "client_member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.invoice_requirements": {
      "name": "invoice_requirements",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "invoice_id": {
          "name": "invoice_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "requirement_id": {
          "name": "requirement_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "invoice_requirements_invoice_id_invoices_id_fk": {
          "name": "invoice_requirements_invoice_id_invoices_id_fk",
          "tableFrom": "invoice_requirements",
          "tableTo": "invoices",
          "columnsFrom": [
            "invoice_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "invoice_requirements_requirement_id_requirements_id_fk": {
          "name": "invoice_requirements_requirement_id_requirements_id_fk",
          "tableFrom": "invoice_requirements",
          "tableTo": "requirements",
          "columnsFrom": [
            "requirement_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.invoices": {
      "name": "invoices",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "invoice_number": {
          "name": "invoice_number",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "invoice_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'draft'"
        },
        "issue_date": {
          "name": "issue_date",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "due_date": {
          "name": "due_date",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "total_amount": {
          "name": "total_amount",
          "type": "numeric(16, 4)",
          "primaryKey": false,
          "notNull": true,
          "default": "'0'"
        },
        "currency": {
          "name": "currency",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'USD'"
        },
        "sender_logo": {
          "name": "sender_logo",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "sender_signature": {
          "name": "sender_signature",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "sender_name": {
          "name": "sender_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "sender_address": {
          "name": "sender_address",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "sender_custom_fields": {
          "name": "sender_custom_fields",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "client_name": {
          "name": "client_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "client_address": {
          "name": "client_address",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "client_custom_fields": {
          "name": "client_custom_fields",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "payment_terms": {
          "name": "payment_terms",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "terms": {
          "name": "terms",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "discount_label": {
          "name": "discount_label",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "discount_amount": {
          "name": "discount_amount",
          "type": "numeric(16, 4)",
          "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": {
        "invoices_project_id_status_idx": {
          "name": "invoices_project_id_status_idx",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "status",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "invoices_project_id_projects_id_fk": {
          "name": "invoices_project_id_projects_id_fk",
          "tableFrom": "invoices",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "invoices_sender_logo_media_id_fk": {
          "name": "invoices_sender_logo_media_id_fk",
          "tableFrom": "invoices",
          "tableTo": "media",
          "columnsFrom": [
            "sender_logo"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "invoices_sender_signature_media_id_fk": {
          "name": "invoices_sender_signature_media_id_fk",
          "tableFrom": "invoices",
          "tableTo": "media",
          "columnsFrom": [
            "sender_signature"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "invoices_invoice_number_unique": {
          "name": "invoices_invoice_number_unique",
          "nullsNotDistinct": false,
          "columns": [
            "invoice_number"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.media": {
      "name": "media",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "uploaded_by_member_id": {
          "name": "uploaded_by_member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "key": {
          "name": "key",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "url": {
          "name": "url",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "content_type": {
          "name": "content_type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "size": {
          "name": "size",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "media_uploaded_by_member_id_members_id_fk": {
          "name": "media_uploaded_by_member_id_members_id_fk",
          "tableFrom": "media",
          "tableTo": "members",
          "columnsFrom": [
            "uploaded_by_member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "media_key_unique": {
          "name": "media_key_unique",
          "nullsNotDistinct": false,
          "columns": [
            "key"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.milestone_requirements": {
      "name": "milestone_requirements",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "milestone_id": {
          "name": "milestone_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "requirement_id": {
          "name": "requirement_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "sort_order": {
          "name": "sort_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        }
      },
      "indexes": {
        "milestone_requirement_unique": {
          "name": "milestone_requirement_unique",
          "columns": [
            {
              "expression": "milestone_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "requirement_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "milestone_requirements_milestone_id_milestones_id_fk": {
          "name": "milestone_requirements_milestone_id_milestones_id_fk",
          "tableFrom": "milestone_requirements",
          "tableTo": "milestones",
          "columnsFrom": [
            "milestone_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "milestone_requirements_requirement_id_requirements_id_fk": {
          "name": "milestone_requirements_requirement_id_requirements_id_fk",
          "tableFrom": "milestone_requirements",
          "tableTo": "requirements",
          "columnsFrom": [
            "requirement_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.milestones": {
      "name": "milestones",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "milestone_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "sort_order": {
          "name": "sort_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "due_date": {
          "name": "due_date",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "completed_at": {
          "name": "completed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "budget_minutes": {
          "name": "budget_minutes",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "currency": {
          "name": "currency",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "default": "'USD'"
        },
        "budget_amount_cents": {
          "name": "budget_amount_cents",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "block_reason": {
          "name": "block_reason",
          "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": {
        "milestones_project_id_projects_id_fk": {
          "name": "milestones_project_id_projects_id_fk",
          "tableFrom": "milestones",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.project_client_assignments": {
      "name": "project_client_assignments",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "member_id": {
          "name": "member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "assigned_at": {
          "name": "assigned_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "project_client_unique": {
          "name": "project_client_unique",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "member_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "project_client_assignments_project_id_projects_id_fk": {
          "name": "project_client_assignments_project_id_projects_id_fk",
          "tableFrom": "project_client_assignments",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "project_client_assignments_member_id_members_id_fk": {
          "name": "project_client_assignments_member_id_members_id_fk",
          "tableFrom": "project_client_assignments",
          "tableTo": "members",
          "columnsFrom": [
            "member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.project_invitations": {
      "name": "project_invitations",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "invitation_id": {
          "name": "invitation_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "project_invitation_type",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "project_invitations_project_id_projects_id_fk": {
          "name": "project_invitations_project_id_projects_id_fk",
          "tableFrom": "project_invitations",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "project_invitations_invitation_id_unique": {
          "name": "project_invitations_invitation_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "invitation_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.project_member_assignments": {
      "name": "project_member_assignments",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "member_id": {
          "name": "member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'member'"
        },
        "assigned_at": {
          "name": "assigned_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "project_member_unique": {
          "name": "project_member_unique",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "member_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "project_member_assignments_project_id_projects_id_fk": {
          "name": "project_member_assignments_project_id_projects_id_fk",
          "tableFrom": "project_member_assignments",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "project_member_assignments_member_id_members_id_fk": {
          "name": "project_member_assignments_member_id_members_id_fk",
          "tableFrom": "project_member_assignments",
          "tableTo": "members",
          "columnsFrom": [
            "member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.project_team_assignments": {
      "name": "project_team_assignments",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "team_id": {
          "name": "team_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "assigned_at": {
          "name": "assigned_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "project_team_unique": {
          "name": "project_team_unique",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "team_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "project_team_assignments_project_id_projects_id_fk": {
          "name": "project_team_assignments_project_id_projects_id_fk",
          "tableFrom": "project_team_assignments",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "project_team_assignments_team_id_teams_id_fk": {
          "name": "project_team_assignments_team_id_teams_id_fk",
          "tableFrom": "project_team_assignments",
          "tableTo": "teams",
          "columnsFrom": [
            "team_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.projects": {
      "name": "projects",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "slug": {
          "name": "slug",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "due_date": {
          "name": "due_date",
          "type": "timestamp",
          "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": {
        "projects_organization_id_organizations_id_fk": {
          "name": "projects_organization_id_organizations_id_fk",
          "tableFrom": "projects",
          "tableTo": "organizations",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "projects_slug_unique": {
          "name": "projects_slug_unique",
          "nullsNotDistinct": false,
          "columns": [
            "slug"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.proposal_deliverables": {
      "name": "proposal_deliverables",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "proposal_id": {
          "name": "proposal_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "quantity": {
          "name": "quantity",
          "type": "numeric(10, 4)",
          "primaryKey": false,
          "notNull": true
        },
        "unit_price": {
          "name": "unit_price",
          "type": "numeric(16, 4)",
          "primaryKey": false,
          "notNull": true
        },
        "amount": {
          "name": "amount",
          "type": "numeric(16, 4)",
          "primaryKey": false,
          "notNull": true
        },
        "sort_order": {
          "name": "sort_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        }
      },
      "indexes": {},
      "foreignKeys": {
        "proposal_deliverables_proposal_id_proposals_id_fk": {
          "name": "proposal_deliverables_proposal_id_proposals_id_fk",
          "tableFrom": "proposal_deliverables",
          "tableTo": "proposals",
          "columnsFrom": [
            "proposal_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.proposal_recipients": {
      "name": "proposal_recipients",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "proposal_id": {
          "name": "proposal_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "client_member_id": {
          "name": "client_member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "sent_at": {
          "name": "sent_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "proposal_recipients_proposal_id_proposals_id_fk": {
          "name": "proposal_recipients_proposal_id_proposals_id_fk",
          "tableFrom": "proposal_recipients",
          "tableTo": "proposals",
          "columnsFrom": [
            "proposal_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "proposal_recipients_client_member_id_members_id_fk": {
          "name": "proposal_recipients_client_member_id_members_id_fk",
          "tableFrom": "proposal_recipients",
          "tableTo": "members",
          "columnsFrom": [
            "client_member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.proposal_signatures": {
      "name": "proposal_signatures",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "proposal_id": {
          "name": "proposal_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "client_member_id": {
          "name": "client_member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "media_id": {
          "name": "media_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "signed_at": {
          "name": "signed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "proposal_signatures_proposal_id_proposals_id_fk": {
          "name": "proposal_signatures_proposal_id_proposals_id_fk",
          "tableFrom": "proposal_signatures",
          "tableTo": "proposals",
          "columnsFrom": [
            "proposal_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "proposal_signatures_client_member_id_members_id_fk": {
          "name": "proposal_signatures_client_member_id_members_id_fk",
          "tableFrom": "proposal_signatures",
          "tableTo": "members",
          "columnsFrom": [
            "client_member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "proposal_signatures_media_id_media_id_fk": {
          "name": "proposal_signatures_media_id_media_id_fk",
          "tableFrom": "proposal_signatures",
          "tableTo": "media",
          "columnsFrom": [
            "media_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.proposals": {
      "name": "proposals",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "author_id": {
          "name": "author_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "slug": {
          "name": "slug",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "body": {
          "name": "body",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "''"
        },
        "terms": {
          "name": "terms",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'draft'"
        },
        "valid_until": {
          "name": "valid_until",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "currency": {
          "name": "currency",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'USD'"
        },
        "total_amount": {
          "name": "total_amount",
          "type": "numeric(16, 4)",
          "primaryKey": false,
          "notNull": true,
          "default": "'0'"
        },
        "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": {
        "proposals_project_id_idx": {
          "name": "proposals_project_id_idx",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "proposals_project_id_projects_id_fk": {
          "name": "proposals_project_id_projects_id_fk",
          "tableFrom": "proposals",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "proposals_author_id_members_id_fk": {
          "name": "proposals_author_id_members_id_fk",
          "tableFrom": "proposals",
          "tableTo": "members",
          "columnsFrom": [
            "author_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "proposals_slug_unique": {
          "name": "proposals_slug_unique",
          "nullsNotDistinct": false,
          "columns": [
            "slug"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.requirement_change_requests": {
      "name": "requirement_change_requests",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "requirement_id": {
          "name": "requirement_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "requested_by_member_id": {
          "name": "requested_by_member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "referenced_thread_ids": {
          "name": "referenced_thread_ids",
          "type": "text[]",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "change_request_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "resolved_at": {
          "name": "resolved_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "requirement_change_requests_requirement_id_requirements_id_fk": {
          "name": "requirement_change_requests_requirement_id_requirements_id_fk",
          "tableFrom": "requirement_change_requests",
          "tableTo": "requirements",
          "columnsFrom": [
            "requirement_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "requirement_change_requests_requested_by_member_id_members_id_fk": {
          "name": "requirement_change_requests_requested_by_member_id_members_id_fk",
          "tableFrom": "requirement_change_requests",
          "tableTo": "members",
          "columnsFrom": [
            "requested_by_member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.requirement_recipients": {
      "name": "requirement_recipients",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "requirement_id": {
          "name": "requirement_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "client_member_id": {
          "name": "client_member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "sent_at": {
          "name": "sent_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "requirement_recipients_requirement_id_requirements_id_fk": {
          "name": "requirement_recipients_requirement_id_requirements_id_fk",
          "tableFrom": "requirement_recipients",
          "tableTo": "requirements",
          "columnsFrom": [
            "requirement_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "requirement_recipients_client_member_id_members_id_fk": {
          "name": "requirement_recipients_client_member_id_members_id_fk",
          "tableFrom": "requirement_recipients",
          "tableTo": "members",
          "columnsFrom": [
            "client_member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.requirement_signatures": {
      "name": "requirement_signatures",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "requirement_id": {
          "name": "requirement_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "client_member_id": {
          "name": "client_member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "signed_at": {
          "name": "signed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "media_id": {
          "name": "media_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "requirement_signatures_requirement_id_requirements_id_fk": {
          "name": "requirement_signatures_requirement_id_requirements_id_fk",
          "tableFrom": "requirement_signatures",
          "tableTo": "requirements",
          "columnsFrom": [
            "requirement_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "requirement_signatures_client_member_id_members_id_fk": {
          "name": "requirement_signatures_client_member_id_members_id_fk",
          "tableFrom": "requirement_signatures",
          "tableTo": "members",
          "columnsFrom": [
            "client_member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "requirement_signatures_media_id_media_id_fk": {
          "name": "requirement_signatures_media_id_media_id_fk",
          "tableFrom": "requirement_signatures",
          "tableTo": "media",
          "columnsFrom": [
            "media_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.requirements": {
      "name": "requirements",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "author_id": {
          "name": "author_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "slug": {
          "name": "slug",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "body": {
          "name": "body",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "''"
        },
        "status": {
          "name": "status",
          "type": "status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'draft'"
        },
        "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": {
        "requirements_project_id_idx": {
          "name": "requirements_project_id_idx",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "requirements_project_id_projects_id_fk": {
          "name": "requirements_project_id_projects_id_fk",
          "tableFrom": "requirements",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "requirements_author_id_members_id_fk": {
          "name": "requirements_author_id_members_id_fk",
          "tableFrom": "requirements",
          "tableTo": "members",
          "columnsFrom": [
            "author_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "requirements_project_id_slug_unique": {
          "name": "requirements_project_id_slug_unique",
          "nullsNotDistinct": false,
          "columns": [
            "project_id",
            "slug"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.settings": {
      "name": "settings",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "default_member_rate": {
          "name": "default_member_rate",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "default_currency": {
          "name": "default_currency",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'USD'"
        },
        "invoice_number_template": {
          "name": "invoice_number_template",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'INV-%year(short)%month(num)-%seq(4)'"
        },
        "default_timesheet_duration": {
          "name": "default_timesheet_duration",
          "type": "timesheet_duration",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'weekly'"
        },
        "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": {
        "org_settings_org_project_unique": {
          "name": "org_settings_org_project_unique",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "org_settings_org_only_unique": {
          "name": "org_settings_org_only_unique",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "where": "\"settings\".\"project_id\" IS NULL",
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "org_settings_org_id_idx": {
          "name": "org_settings_org_id_idx",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "settings_organization_id_organizations_id_fk": {
          "name": "settings_organization_id_organizations_id_fk",
          "tableFrom": "settings",
          "tableTo": "organizations",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "settings_project_id_projects_id_fk": {
          "name": "settings_project_id_projects_id_fk",
          "tableFrom": "settings",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.thread_messages": {
      "name": "thread_messages",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "thread_id": {
          "name": "thread_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "author_member_id": {
          "name": "author_member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "body": {
          "name": "body",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "thread_messages_thread_id_threads_id_fk": {
          "name": "thread_messages_thread_id_threads_id_fk",
          "tableFrom": "thread_messages",
          "tableTo": "threads",
          "columnsFrom": [
            "thread_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "thread_messages_author_member_id_members_id_fk": {
          "name": "thread_messages_author_member_id_members_id_fk",
          "tableFrom": "thread_messages",
          "tableTo": "members",
          "columnsFrom": [
            "author_member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.threads": {
      "name": "threads",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "entity_id": {
          "name": "entity_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "selected_text": {
          "name": "selected_text",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "thread_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'open'"
        },
        "created_by_member_id": {
          "name": "created_by_member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "threads_project_id_idx": {
          "name": "threads_project_id_idx",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "threads_project_id_projects_id_fk": {
          "name": "threads_project_id_projects_id_fk",
          "tableFrom": "threads",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "threads_created_by_member_id_members_id_fk": {
          "name": "threads_created_by_member_id_members_id_fk",
          "tableFrom": "threads",
          "tableTo": "members",
          "columnsFrom": [
            "created_by_member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.member_rates": {
      "name": "member_rates",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "member_id": {
          "name": "member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "hourly_rate": {
          "name": "hourly_rate",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "currency": {
          "name": "currency",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'USD'"
        },
        "effective_from": {
          "name": "effective_from",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "member_rate_effective_unique": {
          "name": "member_rate_effective_unique",
          "columns": [
            {
              "expression": "member_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "effective_from",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "member_rates_member_id_members_id_fk": {
          "name": "member_rates_member_id_members_id_fk",
          "tableFrom": "member_rates",
          "tableTo": "members",
          "columnsFrom": [
            "member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "member_rates_project_id_projects_id_fk": {
          "name": "member_rates_project_id_projects_id_fk",
          "tableFrom": "member_rates",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.pending_member_rates": {
      "name": "pending_member_rates",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "invitation_id": {
          "name": "invitation_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "hourly_rate": {
          "name": "hourly_rate",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "currency": {
          "name": "currency",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'USD'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "pending_member_rates_org_email_idx": {
          "name": "pending_member_rates_org_email_idx",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "email",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "pending_member_rates_invitation_id_unique": {
          "name": "pending_member_rates_invitation_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "invitation_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.project_budgets": {
      "name": "project_budgets",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "budget_minutes": {
          "name": "budget_minutes",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "alert_threshold": {
          "name": "alert_threshold",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 80
        },
        "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": {
        "project_budgets_project_id_projects_id_fk": {
          "name": "project_budgets_project_id_projects_id_fk",
          "tableFrom": "project_budgets",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "project_budgets_project_id_unique": {
          "name": "project_budgets_project_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "project_id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.time_entries": {
      "name": "time_entries",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "requirement_id": {
          "name": "requirement_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "member_id": {
          "name": "member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "date": {
          "name": "date",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "duration_minutes": {
          "name": "duration_minutes",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "billable": {
          "name": "billable",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": true
        },
        "status": {
          "name": "status",
          "type": "status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'draft'"
        },
        "reject_reason": {
          "name": "reject_reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "invoice_id": {
          "name": "invoice_id",
          "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": {
        "time_entries_project_id_status_idx": {
          "name": "time_entries_project_id_status_idx",
          "columns": [
            {
              "expression": "project_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "status",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "time_entries_member_id_idx": {
          "name": "time_entries_member_id_idx",
          "columns": [
            {
              "expression": "member_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "time_entries_project_id_projects_id_fk": {
          "name": "time_entries_project_id_projects_id_fk",
          "tableFrom": "time_entries",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "time_entries_requirement_id_requirements_id_fk": {
          "name": "time_entries_requirement_id_requirements_id_fk",
          "tableFrom": "time_entries",
          "tableTo": "requirements",
          "columnsFrom": [
            "requirement_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "time_entries_member_id_members_id_fk": {
          "name": "time_entries_member_id_members_id_fk",
          "tableFrom": "time_entries",
          "tableTo": "members",
          "columnsFrom": [
            "member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "time_entries_invoice_id_invoices_id_fk": {
          "name": "time_entries_invoice_id_invoices_id_fk",
          "tableFrom": "time_entries",
          "tableTo": "invoices",
          "columnsFrom": [
            "invoice_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.timesheet_report_entries": {
      "name": "timesheet_report_entries",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "report_id": {
          "name": "report_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "time_entry_id": {
          "name": "time_entry_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {
        "timesheet_report_entries_report_id_idx": {
          "name": "timesheet_report_entries_report_id_idx",
          "columns": [
            {
              "expression": "report_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "timesheet_report_entries_report_id_timesheet_reports_id_fk": {
          "name": "timesheet_report_entries_report_id_timesheet_reports_id_fk",
          "tableFrom": "timesheet_report_entries",
          "tableTo": "timesheet_reports",
          "columnsFrom": [
            "report_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "timesheet_report_entries_time_entry_id_time_entries_id_fk": {
          "name": "timesheet_report_entries_time_entry_id_time_entries_id_fk",
          "tableFrom": "timesheet_report_entries",
          "tableTo": "time_entries",
          "columnsFrom": [
            "time_entry_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.timesheet_report_recipients": {
      "name": "timesheet_report_recipients",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "report_id": {
          "name": "report_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "client_member_id": {
          "name": "client_member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "timesheet_report_recipient_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "dispute_reason": {
          "name": "dispute_reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "responded_at": {
          "name": "responded_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "timesheet_report_recipients_report_id_idx": {
          "name": "timesheet_report_recipients_report_id_idx",
          "columns": [
            {
              "expression": "report_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "timesheet_report_recipients_report_id_timesheet_reports_id_fk": {
          "name": "timesheet_report_recipients_report_id_timesheet_reports_id_fk",
          "tableFrom": "timesheet_report_recipients",
          "tableTo": "timesheet_reports",
          "columnsFrom": [
            "report_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "timesheet_report_recipients_client_member_id_members_id_fk": {
          "name": "timesheet_report_recipients_client_member_id_members_id_fk",
          "tableFrom": "timesheet_report_recipients",
          "tableTo": "members",
          "columnsFrom": [
            "client_member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.timesheet_reports": {
      "name": "timesheet_reports",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "timesheet_report_status",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'draft'"
        },
        "total_minutes": {
          "name": "total_minutes",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "total_amount_cents": {
          "name": "total_amount_cents",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "currency": {
          "name": "currency",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'USD'"
        },
        "sent_by_member_id": {
          "name": "sent_by_member_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "dispute_reason": {
          "name": "dispute_reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "sent_at": {
          "name": "sent_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        },
        "responded_at": {
          "name": "responded_at",
          "type": "timestamp",
          "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": {
        "timesheet_reports_project_id_projects_id_fk": {
          "name": "timesheet_reports_project_id_projects_id_fk",
          "tableFrom": "timesheet_reports",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "timesheet_reports_sent_by_member_id_members_id_fk": {
          "name": "timesheet_reports_sent_by_member_id_members_id_fk",
          "tableFrom": "timesheet_reports",
          "tableTo": "members",
          "columnsFrom": [
            "sent_by_member_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {
    "public.change_request_status": {
      "name": "change_request_status",
      "schema": "public",
      "values": [
        "pending",
        "accepted",
        "rejected"
      ]
    },
    "public.status": {
      "name": "status",
      "schema": "public",
      "values": [
        "draft",
        "submitted_to_admin",
        "admin_accepted",
        "admin_rejected",
        "submitted_to_client",
        "client_accepted",
        "client_rejected",
        "changes_requested"
      ]
    },
    "public.thread_status": {
      "name": "thread_status",
      "schema": "public",
      "values": [
        "open",
        "resolved",
        "closed"
      ]
    },
    "public.invoice_status": {
      "name": "invoice_status",
      "schema": "public",
      "values": [
        "draft",
        "sent",
        "disputed",
        "paid",
        "cancelled"
      ]
    },
    "public.milestone_status": {
      "name": "milestone_status",
      "schema": "public",
      "values": [
        "pending",
        "in_progress",
        "completed",
        "blocked"
      ]
    },
    "public.project_invitation_type": {
      "name": "project_invitation_type",
      "schema": "public",
      "values": [
        "member",
        "client"
      ]
    },
    "public.project_status": {
      "name": "project_status",
      "schema": "public",
      "values": [
        "planning",
        "in-progress",
        "on-hold",
        "completed",
        "archived"
      ]
    },
    "public.timesheet_duration": {
      "name": "timesheet_duration",
      "schema": "public",
      "values": [
        "weekly",
        "biweekly",
        "monthly"
      ]
    },
    "public.timesheet_report_recipient_status": {
      "name": "timesheet_report_recipient_status",
      "schema": "public",
      "values": [
        "pending",
        "approved",
        "disputed"
      ]
    },
    "public.timesheet_report_status": {
      "name": "timesheet_report_status",
      "schema": "public",
      "values": [
        "draft",
        "sent",
        "approved",
        "disputed"
      ]
    }
  },
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}