{
  "id": "513c96e9-4968-439e-8fd4-3160db48a557",
  "prevId": "a618184d-b861-4e8c-ac61-8880da261aaf",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.account": {
      "name": "account",
      "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
        },
        "issuer": {
          "name": "issuer",
          "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": {
        "account_userId_idx": {
          "name": "account_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "account_user_id_user_id_fk": {
          "name": "account_user_id_user_id_fk",
          "tableFrom": "account",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.apikey": {
      "name": "apikey",
      "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": {
        "apikey_configId_idx": {
          "name": "apikey_configId_idx",
          "columns": [
            {
              "expression": "config_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "apikey_referenceId_idx": {
          "name": "apikey_referenceId_idx",
          "columns": [
            {
              "expression": "reference_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "apikey_key_idx": {
          "name": "apikey_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.invitation": {
      "name": "invitation",
      "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": {
        "invitation_organizationId_idx": {
          "name": "invitation_organizationId_idx",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "invitation_email_idx": {
          "name": "invitation_email_idx",
          "columns": [
            {
              "expression": "email",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "invitation_organization_id_organization_id_fk": {
          "name": "invitation_organization_id_organization_id_fk",
          "tableFrom": "invitation",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "invitation_inviter_id_user_id_fk": {
          "name": "invitation_inviter_id_user_id_fk",
          "tableFrom": "invitation",
          "tableTo": "user",
          "columnsFrom": [
            "inviter_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.member": {
      "name": "member",
      "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": {
        "member_organizationId_idx": {
          "name": "member_organizationId_idx",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "member_userId_idx": {
          "name": "member_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "member_organization_id_organization_id_fk": {
          "name": "member_organization_id_organization_id_fk",
          "tableFrom": "member",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "member_user_id_user_id_fk": {
          "name": "member_user_id_user_id_fk",
          "tableFrom": "member",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.organization": {
      "name": "organization",
      "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": {
        "organization_slug_uidx": {
          "name": "organization_slug_uidx",
          "columns": [
            {
              "expression": "slug",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "organization_slug_unique": {
          "name": "organization_slug_unique",
          "nullsNotDistinct": false,
          "columns": [
            "slug"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.organization_role": {
      "name": "organization_role",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "permission": {
          "name": "permission",
          "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": false
        }
      },
      "indexes": {
        "organizationRole_organizationId_idx": {
          "name": "organizationRole_organizationId_idx",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "organizationRole_role_idx": {
          "name": "organizationRole_role_idx",
          "columns": [
            {
              "expression": "role",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "organization_role_organization_id_organization_id_fk": {
          "name": "organization_role_organization_id_organization_id_fk",
          "tableFrom": "organization_role",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.session": {
      "name": "session",
      "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": {
        "session_userId_idx": {
          "name": "session_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "session_user_id_user_id_fk": {
          "name": "session_user_id_user_id_fk",
          "tableFrom": "session",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "session_token_unique": {
          "name": "session_token_unique",
          "nullsNotDistinct": false,
          "columns": [
            "token"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.team": {
      "name": "team",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "member_count": {
          "name": "member_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "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": {
        "team_organizationId_idx": {
          "name": "team_organizationId_idx",
          "columns": [
            {
              "expression": "organization_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "team_organization_id_organization_id_fk": {
          "name": "team_organization_id_organization_id_fk",
          "tableFrom": "team",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.team_member": {
      "name": "team_member",
      "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
        },
        "membership_key": {
          "name": "membership_key",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "teamMember_teamId_idx": {
          "name": "teamMember_teamId_idx",
          "columns": [
            {
              "expression": "team_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "teamMember_userId_idx": {
          "name": "teamMember_userId_idx",
          "columns": [
            {
              "expression": "user_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "team_member_team_id_team_id_fk": {
          "name": "team_member_team_id_team_id_fk",
          "tableFrom": "team_member",
          "tableTo": "team",
          "columnsFrom": [
            "team_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "team_member_user_id_user_id_fk": {
          "name": "team_member_user_id_user_id_fk",
          "tableFrom": "team_member",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "team_member_membership_key_unique": {
          "name": "team_member_membership_key_unique",
          "nullsNotDistinct": false,
          "columns": [
            "membership_key"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.user": {
      "name": "user",
      "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()"
        },
        "username": {
          "name": "username",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "display_username": {
          "name": "display_username",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "user_email_unique": {
          "name": "user_email_unique",
          "nullsNotDistinct": false,
          "columns": [
            "email"
          ]
        },
        "user_username_unique": {
          "name": "user_username_unique",
          "nullsNotDistinct": false,
          "columns": [
            "username"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.verification": {
      "name": "verification",
      "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": {
        "verification_identifier_idx": {
          "name": "verification_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.repository": {
      "name": "repository",
      "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
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "organizationId": {
          "name": "organizationId",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "ownerId": {
          "name": "ownerId",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "visibility": {
          "name": "visibility",
          "type": "repository_visibility",
          "typeSchema": "public",
          "primaryKey": false,
          "notNull": true,
          "default": "'private'"
        },
        "lastPushedAt": {
          "name": "lastPushedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "parentRepositoryId": {
          "name": "parentRepositoryId",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "repository_org_slug_idx": {
          "name": "repository_org_slug_idx",
          "columns": [
            {
              "expression": "organizationId",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "slug",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "where": "\"repository\".\"organizationId\" is not null",
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "repository_owner_slug_idx": {
          "name": "repository_owner_slug_idx",
          "columns": [
            {
              "expression": "ownerId",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "slug",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "where": "\"repository\".\"organizationId\" is null",
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "repository_organizationId_organization_id_fk": {
          "name": "repository_organizationId_organization_id_fk",
          "tableFrom": "repository",
          "tableTo": "organization",
          "columnsFrom": [
            "organizationId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "repository_ownerId_user_id_fk": {
          "name": "repository_ownerId_user_id_fk",
          "tableFrom": "repository",
          "tableTo": "user",
          "columnsFrom": [
            "ownerId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "repository_parentRepositoryId_repository_id_fk": {
          "name": "repository_parentRepositoryId_repository_id_fk",
          "tableFrom": "repository",
          "tableTo": "repository",
          "columnsFrom": [
            "parentRepositoryId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "repository_id_unique": {
          "name": "repository_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.repository_path_commit": {
      "name": "repository_path_commit",
      "schema": "",
      "columns": {
        "repositoryId": {
          "name": "repositoryId",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "ref": {
          "name": "ref",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "path": {
          "name": "path",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "commitSha": {
          "name": "commitSha",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "committedAt": {
          "name": "committedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true
        },
        "subject": {
          "name": "subject",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        }
      },
      "indexes": {},
      "foreignKeys": {
        "repository_path_commit_repositoryId_repository_id_fk": {
          "name": "repository_path_commit_repositoryId_repository_id_fk",
          "tableFrom": "repository_path_commit",
          "tableTo": "repository",
          "columnsFrom": [
            "repositoryId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "repository_path_commit_repositoryId_ref_path_pk": {
          "name": "repository_path_commit_repositoryId_ref_path_pk",
          "columns": [
            "repositoryId",
            "ref",
            "path"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.repository_ref_index": {
      "name": "repository_ref_index",
      "schema": "",
      "columns": {
        "repositoryId": {
          "name": "repositoryId",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "ref": {
          "name": "ref",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "indexedCommitSha": {
          "name": "indexedCommitSha",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "repository_ref_index_repositoryId_repository_id_fk": {
          "name": "repository_ref_index_repositoryId_repository_id_fk",
          "tableFrom": "repository_ref_index",
          "tableTo": "repository",
          "columnsFrom": [
            "repositoryId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "repository_ref_index_repositoryId_ref_pk": {
          "name": "repository_ref_index_repositoryId_ref_pk",
          "columns": [
            "repositoryId",
            "ref"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.stars": {
      "name": "stars",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true
        },
        "userId": {
          "name": "userId",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "repositoryId": {
          "name": "repositoryId",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "createdAt": {
          "name": "createdAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updatedAt": {
          "name": "updatedAt",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "stars_userId_repositoryId_index": {
          "name": "stars_userId_repositoryId_index",
          "columns": [
            {
              "expression": "userId",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "repositoryId",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "stars_userId_user_id_fk": {
          "name": "stars_userId_user_id_fk",
          "tableFrom": "stars",
          "tableTo": "user",
          "columnsFrom": [
            "userId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "stars_repositoryId_repository_id_fk": {
          "name": "stars_repositoryId_repository_id_fk",
          "tableFrom": "stars",
          "tableTo": "repository",
          "columnsFrom": [
            "repositoryId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "stars_id_unique": {
          "name": "stars_id_unique",
          "nullsNotDistinct": false,
          "columns": [
            "id"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {
    "public.repository_visibility": {
      "name": "repository_visibility",
      "schema": "public",
      "values": [
        "public",
        "private"
      ]
    }
  },
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}