Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

refactor(server): remove legacy migration journals (#824)

Corentin Thomasset2ac51dc06691
diff --git a/apps/papra-server/package.json b/apps/papra-server/package.json
index 568909d9..146e89a0 100644
--- a/apps/papra-server/package.json
+++ b/apps/papra-server/package.json
@@ -26,7 +26,7 @@
"migrate:down": "tsx --env-file-if-exists=.env src/scripts/migrate-down.script.ts | crowlog-pretty",
"migrate:up:prod": "tsx src/scripts/migrate-up.script.ts",
"migrate:push": "drizzle-kit push",
- "migrate:create": "sh -c 'drizzle-kit generate --name \"$1\" && tsx --env-file-if-exists=.env src/scripts/create-migration.ts \"$1\" | crowlog-pretty' --",
+ "migrate:create": "sh -c 'tsx --env-file-if-exists=.env src/scripts/create-migration.ts \"$1\" | crowlog-pretty' --",
"db:studio": "drizzle-kit studio",
"clean:dist": "rm -rf dist",
"clean:db": "rm db.sqlite",
diff --git a/apps/papra-server/src/migrations/meta/0000_snapshot.json b/apps/papra-server/src/migrations/meta/0000_snapshot.json
deleted file mode 100644
index 6161cc85..00000000
--- a/apps/papra-server/src/migrations/meta/0000_snapshot.json
+++ /dev/null
@@ -1,1216 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "cdc4a655-0dd1-42e5-8e2d-516570b59da6",
- "prevId": "00000000-0000-0000-0000-000000000000",
- "tables": {
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_name_unique": {
- "name": "tags_organization_id_name_unique",
- "columns": [
- "organization_id",
- "name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "organizations",
- "columnsFrom": [
- "active_organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/0001_snapshot.json b/apps/papra-server/src/migrations/meta/0001_snapshot.json
deleted file mode 100644
index 3a8e531b..00000000
--- a/apps/papra-server/src/migrations/meta/0001_snapshot.json
+++ /dev/null
@@ -1,1216 +0,0 @@
-{
- "id": "4d99e358-8e33-4991-80c4-d7595c094310",
- "prevId": "cdc4a655-0dd1-42e5-8e2d-516570b59da6",
- "version": "6",
- "dialect": "sqlite",
- "tables": {
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "columnsFrom": [
- "organization_id"
- ],
- "tableTo": "organizations",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "columnsFrom": [
- "created_by"
- ],
- "tableTo": "users",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "set null"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "columnsFrom": [
- "deleted_by"
- ],
- "tableTo": "users",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "set null"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "columnsFrom": [
- "organization_id"
- ],
- "tableTo": "organizations",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "columnsFrom": [
- "inviter_id"
- ],
- "tableTo": "users",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "columnsFrom": [
- "organization_id"
- ],
- "tableTo": "organizations",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "columnsFrom": [
- "user_id"
- ],
- "tableTo": "users",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "columnsFrom": [
- "user_id"
- ],
- "tableTo": "users",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "columnsFrom": [
- "document_id"
- ],
- "tableTo": "documents",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "columnsFrom": [
- "tag_id"
- ],
- "tableTo": "tags",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_name_unique": {
- "name": "tags_organization_id_name_unique",
- "columns": [
- "organization_id",
- "name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "columnsFrom": [
- "organization_id"
- ],
- "tableTo": "organizations",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "columnsFrom": [
- "user_id"
- ],
- "tableTo": "users",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "columnsFrom": [
- "user_id"
- ],
- "tableTo": "users",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "columnsFrom": [
- "active_organization_id"
- ],
- "tableTo": "organizations",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "set null"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "columnsFrom": [
- "organization_id"
- ],
- "tableTo": "organizations",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "columnsFrom": [
- "organization_id"
- ],
- "tableTo": "organizations",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "cascade",
- "onDelete": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "columns": {},
- "schemas": {},
- "tables": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/0002_snapshot.json b/apps/papra-server/src/migrations/meta/0002_snapshot.json
deleted file mode 100644
index 4c9d0fd0..00000000
--- a/apps/papra-server/src/migrations/meta/0002_snapshot.json
+++ /dev/null
@@ -1,1443 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "6d328e8d-0cb2-440d-beb4-ebb9b92370e6",
- "prevId": "4d99e358-8e33-4991-80c4-d7595c094310",
- "tables": {
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_name_unique": {
- "name": "tags_organization_id_name_unique",
- "columns": [
- "organization_id",
- "name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "organizations",
- "columnsFrom": [
- "active_organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_actions": {
- "name": "tagging_rule_actions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "tagging_rule_actions_tag_id_tags_id_fk": {
- "name": "tagging_rule_actions_tag_id_tags_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_conditions": {
- "name": "tagging_rule_conditions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "field": {
- "name": "field",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "operator": {
- "name": "operator",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_case_sensitive": {
- "name": "is_case_sensitive",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_conditions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rules": {
- "name": "tagging_rules",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rules_organization_id_organizations_id_fk": {
- "name": "tagging_rules_organization_id_organizations_id_fk",
- "tableFrom": "tagging_rules",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/0003_snapshot.json b/apps/papra-server/src/migrations/meta/0003_snapshot.json
deleted file mode 100644
index d918442d..00000000
--- a/apps/papra-server/src/migrations/meta/0003_snapshot.json
+++ /dev/null
@@ -1,1612 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "5986ec37-a9d8-46a4-8669-e0650dac4726",
- "prevId": "6d328e8d-0cb2-440d-beb4-ebb9b92370e6",
- "tables": {
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_name_unique": {
- "name": "tags_organization_id_name_unique",
- "columns": [
- "organization_id",
- "name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_key_organizations": {
- "name": "api_key_organizations",
- "columns": {
- "api_key_id": {
- "name": "api_key_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_member_id": {
- "name": "organization_member_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "api_key_organizations_api_key_id_api_keys_id_fk": {
- "name": "api_key_organizations_api_key_id_api_keys_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "api_keys",
- "columnsFrom": [
- "api_key_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "api_key_organizations_organization_member_id_organization_members_id_fk": {
- "name": "api_key_organizations_organization_member_id_organization_members_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "organization_members",
- "columnsFrom": [
- "organization_member_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_keys": {
- "name": "api_keys",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "key_hash": {
- "name": "key_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "prefix": {
- "name": "prefix",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "last_used_at": {
- "name": "last_used_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "all_organizations": {
- "name": "all_organizations",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "api_keys_key_hash_unique": {
- "name": "api_keys_key_hash_unique",
- "columns": [
- "key_hash"
- ],
- "isUnique": true
- },
- "key_hash_index": {
- "name": "key_hash_index",
- "columns": [
- "key_hash"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "api_keys_user_id_users_id_fk": {
- "name": "api_keys_user_id_users_id_fk",
- "tableFrom": "api_keys",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "organizations",
- "columnsFrom": [
- "active_organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_actions": {
- "name": "tagging_rule_actions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "tagging_rule_actions_tag_id_tags_id_fk": {
- "name": "tagging_rule_actions_tag_id_tags_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_conditions": {
- "name": "tagging_rule_conditions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "field": {
- "name": "field",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "operator": {
- "name": "operator",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_case_sensitive": {
- "name": "is_case_sensitive",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_conditions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rules": {
- "name": "tagging_rules",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rules_organization_id_organizations_id_fk": {
- "name": "tagging_rules_organization_id_organizations_id_fk",
- "tableFrom": "tagging_rules",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/0004_snapshot.json b/apps/papra-server/src/migrations/meta/0004_snapshot.json
deleted file mode 100644
index dc0a44a2..00000000
--- a/apps/papra-server/src/migrations/meta/0004_snapshot.json
+++ /dev/null
@@ -1,1861 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "73fa27b4-1c62-4631-b2e8-9e6b9128d030",
- "prevId": "5986ec37-a9d8-46a4-8669-e0650dac4726",
- "tables": {
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_name_unique": {
- "name": "tags_organization_id_name_unique",
- "columns": [
- "organization_id",
- "name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_key_organizations": {
- "name": "api_key_organizations",
- "columns": {
- "api_key_id": {
- "name": "api_key_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_member_id": {
- "name": "organization_member_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "api_key_organizations_api_key_id_api_keys_id_fk": {
- "name": "api_key_organizations_api_key_id_api_keys_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "api_keys",
- "columnsFrom": [
- "api_key_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "api_key_organizations_organization_member_id_organization_members_id_fk": {
- "name": "api_key_organizations_organization_member_id_organization_members_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "organization_members",
- "columnsFrom": [
- "organization_member_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_keys": {
- "name": "api_keys",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "key_hash": {
- "name": "key_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "prefix": {
- "name": "prefix",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "last_used_at": {
- "name": "last_used_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "all_organizations": {
- "name": "all_organizations",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "api_keys_key_hash_unique": {
- "name": "api_keys_key_hash_unique",
- "columns": [
- "key_hash"
- ],
- "isUnique": true
- },
- "key_hash_index": {
- "name": "key_hash_index",
- "columns": [
- "key_hash"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "api_keys_user_id_users_id_fk": {
- "name": "api_keys_user_id_users_id_fk",
- "tableFrom": "api_keys",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "organizations",
- "columnsFrom": [
- "active_organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_actions": {
- "name": "tagging_rule_actions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "tagging_rule_actions_tag_id_tags_id_fk": {
- "name": "tagging_rule_actions_tag_id_tags_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_conditions": {
- "name": "tagging_rule_conditions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "field": {
- "name": "field",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "operator": {
- "name": "operator",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_case_sensitive": {
- "name": "is_case_sensitive",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_conditions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rules": {
- "name": "tagging_rules",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rules_organization_id_organizations_id_fk": {
- "name": "tagging_rules_organization_id_organizations_id_fk",
- "tableFrom": "tagging_rules",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_deliveries": {
- "name": "webhook_deliveries",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "request_payload": {
- "name": "request_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_payload": {
- "name": "response_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_status": {
- "name": "response_status",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhook_deliveries_webhook_id_webhooks_id_fk": {
- "name": "webhook_deliveries_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_deliveries",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_events": {
- "name": "webhook_events",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "webhook_events_webhook_id_event_name_unique": {
- "name": "webhook_events_webhook_id_event_name_unique",
- "columns": [
- "webhook_id",
- "event_name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "webhook_events_webhook_id_webhooks_id_fk": {
- "name": "webhook_events_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_events",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhooks": {
- "name": "webhooks",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "url": {
- "name": "url",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "secret": {
- "name": "secret",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhooks_created_by_users_id_fk": {
- "name": "webhooks_created_by_users_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "webhooks_organization_id_organizations_id_fk": {
- "name": "webhooks_organization_id_organizations_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/0005_snapshot.json b/apps/papra-server/src/migrations/meta/0005_snapshot.json
deleted file mode 100644
index d47bdb8a..00000000
--- a/apps/papra-server/src/migrations/meta/0005_snapshot.json
+++ /dev/null
@@ -1,1871 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "df039595-1e23-4acc-be89-8e6fcc1775b5",
- "prevId": "73fa27b4-1c62-4631-b2e8-9e6b9128d030",
- "tables": {
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'pending'"
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_invitations_organization_email_unique": {
- "name": "organization_invitations_organization_email_unique",
- "columns": [
- "organization_id",
- "email"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_name_unique": {
- "name": "tags_organization_id_name_unique",
- "columns": [
- "organization_id",
- "name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_key_organizations": {
- "name": "api_key_organizations",
- "columns": {
- "api_key_id": {
- "name": "api_key_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_member_id": {
- "name": "organization_member_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "api_key_organizations_api_key_id_api_keys_id_fk": {
- "name": "api_key_organizations_api_key_id_api_keys_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "api_keys",
- "columnsFrom": [
- "api_key_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "api_key_organizations_organization_member_id_organization_members_id_fk": {
- "name": "api_key_organizations_organization_member_id_organization_members_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "organization_members",
- "columnsFrom": [
- "organization_member_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_keys": {
- "name": "api_keys",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "key_hash": {
- "name": "key_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "prefix": {
- "name": "prefix",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "last_used_at": {
- "name": "last_used_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "all_organizations": {
- "name": "all_organizations",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "api_keys_key_hash_unique": {
- "name": "api_keys_key_hash_unique",
- "columns": [
- "key_hash"
- ],
- "isUnique": true
- },
- "key_hash_index": {
- "name": "key_hash_index",
- "columns": [
- "key_hash"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "api_keys_user_id_users_id_fk": {
- "name": "api_keys_user_id_users_id_fk",
- "tableFrom": "api_keys",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "organizations",
- "columnsFrom": [
- "active_organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_actions": {
- "name": "tagging_rule_actions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "tagging_rule_actions_tag_id_tags_id_fk": {
- "name": "tagging_rule_actions_tag_id_tags_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_conditions": {
- "name": "tagging_rule_conditions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "field": {
- "name": "field",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "operator": {
- "name": "operator",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_case_sensitive": {
- "name": "is_case_sensitive",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_conditions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rules": {
- "name": "tagging_rules",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rules_organization_id_organizations_id_fk": {
- "name": "tagging_rules_organization_id_organizations_id_fk",
- "tableFrom": "tagging_rules",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_deliveries": {
- "name": "webhook_deliveries",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "request_payload": {
- "name": "request_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_payload": {
- "name": "response_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_status": {
- "name": "response_status",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhook_deliveries_webhook_id_webhooks_id_fk": {
- "name": "webhook_deliveries_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_deliveries",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_events": {
- "name": "webhook_events",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "webhook_events_webhook_id_event_name_unique": {
- "name": "webhook_events_webhook_id_event_name_unique",
- "columns": [
- "webhook_id",
- "event_name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "webhook_events_webhook_id_webhooks_id_fk": {
- "name": "webhook_events_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_events",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhooks": {
- "name": "webhooks",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "url": {
- "name": "url",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "secret": {
- "name": "secret",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhooks_created_by_users_id_fk": {
- "name": "webhooks_created_by_users_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "webhooks_organization_id_organizations_id_fk": {
- "name": "webhooks_organization_id_organizations_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/0006_snapshot.json b/apps/papra-server/src/migrations/meta/0006_snapshot.json
deleted file mode 100644
index c7e59c1c..00000000
--- a/apps/papra-server/src/migrations/meta/0006_snapshot.json
+++ /dev/null
@@ -1,1970 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "2033ceb9-a1e6-4b1a-972d-84922f2ed9b0",
- "prevId": "df039595-1e23-4acc-be89-8e6fcc1775b5",
- "tables": {
- "document_activity_log": {
- "name": "document_activity_log",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event": {
- "name": "event",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_data": {
- "name": "event_data",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "document_activity_log_document_id_documents_id_fk": {
- "name": "document_activity_log_document_id_documents_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "document_activity_log_user_id_users_id_fk": {
- "name": "document_activity_log_user_id_users_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "no action",
- "onUpdate": "cascade"
- },
- "document_activity_log_tag_id_tags_id_fk": {
- "name": "document_activity_log_tag_id_tags_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "no action",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'pending'"
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_invitations_organization_email_unique": {
- "name": "organization_invitations_organization_email_unique",
- "columns": [
- "organization_id",
- "email"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_name_unique": {
- "name": "tags_organization_id_name_unique",
- "columns": [
- "organization_id",
- "name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_key_organizations": {
- "name": "api_key_organizations",
- "columns": {
- "api_key_id": {
- "name": "api_key_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_member_id": {
- "name": "organization_member_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "api_key_organizations_api_key_id_api_keys_id_fk": {
- "name": "api_key_organizations_api_key_id_api_keys_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "api_keys",
- "columnsFrom": [
- "api_key_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "api_key_organizations_organization_member_id_organization_members_id_fk": {
- "name": "api_key_organizations_organization_member_id_organization_members_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "organization_members",
- "columnsFrom": [
- "organization_member_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_keys": {
- "name": "api_keys",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "key_hash": {
- "name": "key_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "prefix": {
- "name": "prefix",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "last_used_at": {
- "name": "last_used_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "all_organizations": {
- "name": "all_organizations",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "api_keys_key_hash_unique": {
- "name": "api_keys_key_hash_unique",
- "columns": [
- "key_hash"
- ],
- "isUnique": true
- },
- "key_hash_index": {
- "name": "key_hash_index",
- "columns": [
- "key_hash"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "api_keys_user_id_users_id_fk": {
- "name": "api_keys_user_id_users_id_fk",
- "tableFrom": "api_keys",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "organizations",
- "columnsFrom": [
- "active_organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_actions": {
- "name": "tagging_rule_actions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "tagging_rule_actions_tag_id_tags_id_fk": {
- "name": "tagging_rule_actions_tag_id_tags_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_conditions": {
- "name": "tagging_rule_conditions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "field": {
- "name": "field",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "operator": {
- "name": "operator",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_case_sensitive": {
- "name": "is_case_sensitive",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_conditions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rules": {
- "name": "tagging_rules",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rules_organization_id_organizations_id_fk": {
- "name": "tagging_rules_organization_id_organizations_id_fk",
- "tableFrom": "tagging_rules",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_deliveries": {
- "name": "webhook_deliveries",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "request_payload": {
- "name": "request_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_payload": {
- "name": "response_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_status": {
- "name": "response_status",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhook_deliveries_webhook_id_webhooks_id_fk": {
- "name": "webhook_deliveries_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_deliveries",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_events": {
- "name": "webhook_events",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "webhook_events_webhook_id_event_name_unique": {
- "name": "webhook_events_webhook_id_event_name_unique",
- "columns": [
- "webhook_id",
- "event_name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "webhook_events_webhook_id_webhooks_id_fk": {
- "name": "webhook_events_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_events",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhooks": {
- "name": "webhooks",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "url": {
- "name": "url",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "secret": {
- "name": "secret",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhooks_created_by_users_id_fk": {
- "name": "webhooks_created_by_users_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "webhooks_organization_id_organizations_id_fk": {
- "name": "webhooks_organization_id_organizations_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/0007_snapshot.json b/apps/papra-server/src/migrations/meta/0007_snapshot.json
deleted file mode 100644
index addd86ad..00000000
--- a/apps/papra-server/src/migrations/meta/0007_snapshot.json
+++ /dev/null
@@ -1,1970 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "7fb3b6cf-299a-430f-84be-9050d2ff9a65",
- "prevId": "2033ceb9-a1e6-4b1a-972d-84922f2ed9b0",
- "tables": {
- "document_activity_log": {
- "name": "document_activity_log",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event": {
- "name": "event",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_data": {
- "name": "event_data",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "document_activity_log_document_id_documents_id_fk": {
- "name": "document_activity_log_document_id_documents_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "document_activity_log_user_id_users_id_fk": {
- "name": "document_activity_log_user_id_users_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "document_activity_log_tag_id_tags_id_fk": {
- "name": "document_activity_log_tag_id_tags_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'pending'"
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_invitations_organization_email_unique": {
- "name": "organization_invitations_organization_email_unique",
- "columns": [
- "organization_id",
- "email"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_name_unique": {
- "name": "tags_organization_id_name_unique",
- "columns": [
- "organization_id",
- "name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_key_organizations": {
- "name": "api_key_organizations",
- "columns": {
- "api_key_id": {
- "name": "api_key_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_member_id": {
- "name": "organization_member_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "api_key_organizations_api_key_id_api_keys_id_fk": {
- "name": "api_key_organizations_api_key_id_api_keys_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "api_keys",
- "columnsFrom": [
- "api_key_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "api_key_organizations_organization_member_id_organization_members_id_fk": {
- "name": "api_key_organizations_organization_member_id_organization_members_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "organization_members",
- "columnsFrom": [
- "organization_member_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_keys": {
- "name": "api_keys",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "key_hash": {
- "name": "key_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "prefix": {
- "name": "prefix",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "last_used_at": {
- "name": "last_used_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "all_organizations": {
- "name": "all_organizations",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "api_keys_key_hash_unique": {
- "name": "api_keys_key_hash_unique",
- "columns": [
- "key_hash"
- ],
- "isUnique": true
- },
- "key_hash_index": {
- "name": "key_hash_index",
- "columns": [
- "key_hash"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "api_keys_user_id_users_id_fk": {
- "name": "api_keys_user_id_users_id_fk",
- "tableFrom": "api_keys",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "organizations",
- "columnsFrom": [
- "active_organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_actions": {
- "name": "tagging_rule_actions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "tagging_rule_actions_tag_id_tags_id_fk": {
- "name": "tagging_rule_actions_tag_id_tags_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_conditions": {
- "name": "tagging_rule_conditions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "field": {
- "name": "field",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "operator": {
- "name": "operator",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_case_sensitive": {
- "name": "is_case_sensitive",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_conditions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rules": {
- "name": "tagging_rules",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rules_organization_id_organizations_id_fk": {
- "name": "tagging_rules_organization_id_organizations_id_fk",
- "tableFrom": "tagging_rules",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_deliveries": {
- "name": "webhook_deliveries",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "request_payload": {
- "name": "request_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_payload": {
- "name": "response_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_status": {
- "name": "response_status",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhook_deliveries_webhook_id_webhooks_id_fk": {
- "name": "webhook_deliveries_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_deliveries",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_events": {
- "name": "webhook_events",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "webhook_events_webhook_id_event_name_unique": {
- "name": "webhook_events_webhook_id_event_name_unique",
- "columns": [
- "webhook_id",
- "event_name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "webhook_events_webhook_id_webhooks_id_fk": {
- "name": "webhook_events_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_events",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhooks": {
- "name": "webhooks",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "url": {
- "name": "url",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "secret": {
- "name": "secret",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhooks_created_by_users_id_fk": {
- "name": "webhooks_created_by_users_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "webhooks_organization_id_organizations_id_fk": {
- "name": "webhooks_organization_id_organizations_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/0009_snapshot.json b/apps/papra-server/src/migrations/meta/0009_snapshot.json
deleted file mode 100644
index 30e611b7..00000000
--- a/apps/papra-server/src/migrations/meta/0009_snapshot.json
+++ /dev/null
@@ -1,1998 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "6f0abb3a-800c-4968-a528-95f3f254c1ef",
- "prevId": "7fb3b6cf-299a-430f-84be-9050d2ff9a65",
- "tables": {
- "document_activity_log": {
- "name": "document_activity_log",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event": {
- "name": "event",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_data": {
- "name": "event_data",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "document_activity_log_document_id_documents_id_fk": {
- "name": "document_activity_log_document_id_documents_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "document_activity_log_user_id_users_id_fk": {
- "name": "document_activity_log_user_id_users_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "document_activity_log_tag_id_tags_id_fk": {
- "name": "document_activity_log_tag_id_tags_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- },
- "file_encryption_key_wrapped": {
- "name": "file_encryption_key_wrapped",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "file_encryption_kek_version": {
- "name": "file_encryption_kek_version",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "file_encryption_algorithm": {
- "name": "file_encryption_algorithm",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- },
- "documents_file_encryption_kek_version_index": {
- "name": "documents_file_encryption_kek_version_index",
- "columns": [
- "file_encryption_kek_version"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'pending'"
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_invitations_organization_email_unique": {
- "name": "organization_invitations_organization_email_unique",
- "columns": [
- "organization_id",
- "email"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_name_unique": {
- "name": "tags_organization_id_name_unique",
- "columns": [
- "organization_id",
- "name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_key_organizations": {
- "name": "api_key_organizations",
- "columns": {
- "api_key_id": {
- "name": "api_key_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_member_id": {
- "name": "organization_member_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "api_key_organizations_api_key_id_api_keys_id_fk": {
- "name": "api_key_organizations_api_key_id_api_keys_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "api_keys",
- "columnsFrom": [
- "api_key_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "api_key_organizations_organization_member_id_organization_members_id_fk": {
- "name": "api_key_organizations_organization_member_id_organization_members_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "organization_members",
- "columnsFrom": [
- "organization_member_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_keys": {
- "name": "api_keys",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "key_hash": {
- "name": "key_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "prefix": {
- "name": "prefix",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "last_used_at": {
- "name": "last_used_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "all_organizations": {
- "name": "all_organizations",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "api_keys_key_hash_unique": {
- "name": "api_keys_key_hash_unique",
- "columns": [
- "key_hash"
- ],
- "isUnique": true
- },
- "key_hash_index": {
- "name": "key_hash_index",
- "columns": [
- "key_hash"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "api_keys_user_id_users_id_fk": {
- "name": "api_keys_user_id_users_id_fk",
- "tableFrom": "api_keys",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "organizations",
- "columnsFrom": [
- "active_organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_actions": {
- "name": "tagging_rule_actions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "tagging_rule_actions_tag_id_tags_id_fk": {
- "name": "tagging_rule_actions_tag_id_tags_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_conditions": {
- "name": "tagging_rule_conditions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "field": {
- "name": "field",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "operator": {
- "name": "operator",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_case_sensitive": {
- "name": "is_case_sensitive",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_conditions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rules": {
- "name": "tagging_rules",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rules_organization_id_organizations_id_fk": {
- "name": "tagging_rules_organization_id_organizations_id_fk",
- "tableFrom": "tagging_rules",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_deliveries": {
- "name": "webhook_deliveries",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "request_payload": {
- "name": "request_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_payload": {
- "name": "response_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_status": {
- "name": "response_status",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhook_deliveries_webhook_id_webhooks_id_fk": {
- "name": "webhook_deliveries_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_deliveries",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_events": {
- "name": "webhook_events",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "webhook_events_webhook_id_event_name_unique": {
- "name": "webhook_events_webhook_id_event_name_unique",
- "columns": [
- "webhook_id",
- "event_name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "webhook_events_webhook_id_webhooks_id_fk": {
- "name": "webhook_events_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_events",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhooks": {
- "name": "webhooks",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "url": {
- "name": "url",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "secret": {
- "name": "secret",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhooks_created_by_users_id_fk": {
- "name": "webhooks_created_by_users_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "webhooks_organization_id_organizations_id_fk": {
- "name": "webhooks_organization_id_organizations_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/0010_snapshot.json b/apps/papra-server/src/migrations/meta/0010_snapshot.json
deleted file mode 100644
index 811acc13..00000000
--- a/apps/papra-server/src/migrations/meta/0010_snapshot.json
+++ /dev/null
@@ -1,2050 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "1c4a2eb0-efbe-486d-a4ea-44768fbdfeff",
- "prevId": "6f0abb3a-800c-4968-a528-95f3f254c1ef",
- "tables": {
- "document_activity_log": {
- "name": "document_activity_log",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event": {
- "name": "event",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_data": {
- "name": "event_data",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "document_activity_log_document_id_documents_id_fk": {
- "name": "document_activity_log_document_id_documents_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "document_activity_log_user_id_users_id_fk": {
- "name": "document_activity_log_user_id_users_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "document_activity_log_tag_id_tags_id_fk": {
- "name": "document_activity_log_tag_id_tags_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- },
- "file_encryption_key_wrapped": {
- "name": "file_encryption_key_wrapped",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "file_encryption_kek_version": {
- "name": "file_encryption_kek_version",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "file_encryption_algorithm": {
- "name": "file_encryption_algorithm",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- },
- "documents_file_encryption_kek_version_index": {
- "name": "documents_file_encryption_kek_version_index",
- "columns": [
- "file_encryption_kek_version"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'pending'"
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_invitations_organization_email_unique": {
- "name": "organization_invitations_organization_email_unique",
- "columns": [
- "organization_id",
- "email"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scheduled_purge_at": {
- "name": "scheduled_purge_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "organizations_deleted_at_purge_at_index": {
- "name": "organizations_deleted_at_purge_at_index",
- "columns": [
- "deleted_at",
- "scheduled_purge_at"
- ],
- "isUnique": false
- },
- "organizations_deleted_by_deleted_at_index": {
- "name": "organizations_deleted_by_deleted_at_index",
- "columns": [
- "deleted_by",
- "deleted_at"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "organizations_deleted_by_users_id_fk": {
- "name": "organizations_deleted_by_users_id_fk",
- "tableFrom": "organizations",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_name_unique": {
- "name": "tags_organization_id_name_unique",
- "columns": [
- "organization_id",
- "name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_key_organizations": {
- "name": "api_key_organizations",
- "columns": {
- "api_key_id": {
- "name": "api_key_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_member_id": {
- "name": "organization_member_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "api_key_organizations_api_key_id_api_keys_id_fk": {
- "name": "api_key_organizations_api_key_id_api_keys_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "api_keys",
- "columnsFrom": [
- "api_key_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "api_key_organizations_organization_member_id_organization_members_id_fk": {
- "name": "api_key_organizations_organization_member_id_organization_members_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "organization_members",
- "columnsFrom": [
- "organization_member_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_keys": {
- "name": "api_keys",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "key_hash": {
- "name": "key_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "prefix": {
- "name": "prefix",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "last_used_at": {
- "name": "last_used_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "all_organizations": {
- "name": "all_organizations",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "api_keys_key_hash_unique": {
- "name": "api_keys_key_hash_unique",
- "columns": [
- "key_hash"
- ],
- "isUnique": true
- },
- "key_hash_index": {
- "name": "key_hash_index",
- "columns": [
- "key_hash"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "api_keys_user_id_users_id_fk": {
- "name": "api_keys_user_id_users_id_fk",
- "tableFrom": "api_keys",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "organizations",
- "columnsFrom": [
- "active_organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_actions": {
- "name": "tagging_rule_actions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "tagging_rule_actions_tag_id_tags_id_fk": {
- "name": "tagging_rule_actions_tag_id_tags_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_conditions": {
- "name": "tagging_rule_conditions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "field": {
- "name": "field",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "operator": {
- "name": "operator",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_case_sensitive": {
- "name": "is_case_sensitive",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_conditions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rules": {
- "name": "tagging_rules",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rules_organization_id_organizations_id_fk": {
- "name": "tagging_rules_organization_id_organizations_id_fk",
- "tableFrom": "tagging_rules",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_deliveries": {
- "name": "webhook_deliveries",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "request_payload": {
- "name": "request_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_payload": {
- "name": "response_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_status": {
- "name": "response_status",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhook_deliveries_webhook_id_webhooks_id_fk": {
- "name": "webhook_deliveries_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_deliveries",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_events": {
- "name": "webhook_events",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "webhook_events_webhook_id_event_name_unique": {
- "name": "webhook_events_webhook_id_event_name_unique",
- "columns": [
- "webhook_id",
- "event_name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "webhook_events_webhook_id_webhooks_id_fk": {
- "name": "webhook_events_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_events",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhooks": {
- "name": "webhooks",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "url": {
- "name": "url",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "secret": {
- "name": "secret",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhooks_created_by_users_id_fk": {
- "name": "webhooks_created_by_users_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "webhooks_organization_id_organizations_id_fk": {
- "name": "webhooks_organization_id_organizations_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/0011_snapshot.json b/apps/papra-server/src/migrations/meta/0011_snapshot.json
deleted file mode 100644
index 166372ad..00000000
--- a/apps/papra-server/src/migrations/meta/0011_snapshot.json
+++ /dev/null
@@ -1,2058 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "7407bb9b-b179-4a4c-89c6-ac869979f836",
- "prevId": "1c4a2eb0-efbe-486d-a4ea-44768fbdfeff",
- "tables": {
- "document_activity_log": {
- "name": "document_activity_log",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event": {
- "name": "event",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_data": {
- "name": "event_data",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "document_activity_log_document_id_documents_id_fk": {
- "name": "document_activity_log_document_id_documents_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "document_activity_log_user_id_users_id_fk": {
- "name": "document_activity_log_user_id_users_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "document_activity_log_tag_id_tags_id_fk": {
- "name": "document_activity_log_tag_id_tags_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- },
- "file_encryption_key_wrapped": {
- "name": "file_encryption_key_wrapped",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "file_encryption_kek_version": {
- "name": "file_encryption_kek_version",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "file_encryption_algorithm": {
- "name": "file_encryption_algorithm",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- },
- "documents_file_encryption_kek_version_index": {
- "name": "documents_file_encryption_kek_version_index",
- "columns": [
- "file_encryption_kek_version"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'pending'"
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_invitations_organization_email_unique": {
- "name": "organization_invitations_organization_email_unique",
- "columns": [
- "organization_id",
- "email"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scheduled_purge_at": {
- "name": "scheduled_purge_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "organizations_deleted_at_purge_at_index": {
- "name": "organizations_deleted_at_purge_at_index",
- "columns": [
- "deleted_at",
- "scheduled_purge_at"
- ],
- "isUnique": false
- },
- "organizations_deleted_by_deleted_at_index": {
- "name": "organizations_deleted_by_deleted_at_index",
- "columns": [
- "deleted_by",
- "deleted_at"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "organizations_deleted_by_users_id_fk": {
- "name": "organizations_deleted_by_users_id_fk",
- "tableFrom": "organizations",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_name_unique": {
- "name": "tags_organization_id_name_unique",
- "columns": [
- "organization_id",
- "name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_key_organizations": {
- "name": "api_key_organizations",
- "columns": {
- "api_key_id": {
- "name": "api_key_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_member_id": {
- "name": "organization_member_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "api_key_organizations_api_key_id_api_keys_id_fk": {
- "name": "api_key_organizations_api_key_id_api_keys_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "api_keys",
- "columnsFrom": [
- "api_key_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "api_key_organizations_organization_member_id_organization_members_id_fk": {
- "name": "api_key_organizations_organization_member_id_organization_members_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "organization_members",
- "columnsFrom": [
- "organization_member_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_keys": {
- "name": "api_keys",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "key_hash": {
- "name": "key_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "prefix": {
- "name": "prefix",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "last_used_at": {
- "name": "last_used_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "all_organizations": {
- "name": "all_organizations",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "api_keys_key_hash_unique": {
- "name": "api_keys_key_hash_unique",
- "columns": [
- "key_hash"
- ],
- "isUnique": true
- },
- "key_hash_index": {
- "name": "key_hash_index",
- "columns": [
- "key_hash"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "api_keys_user_id_users_id_fk": {
- "name": "api_keys_user_id_users_id_fk",
- "tableFrom": "api_keys",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "organizations",
- "columnsFrom": [
- "active_organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_actions": {
- "name": "tagging_rule_actions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "tagging_rule_actions_tag_id_tags_id_fk": {
- "name": "tagging_rule_actions_tag_id_tags_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_conditions": {
- "name": "tagging_rule_conditions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "field": {
- "name": "field",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "operator": {
- "name": "operator",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_case_sensitive": {
- "name": "is_case_sensitive",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_conditions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rules": {
- "name": "tagging_rules",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "condition_match_mode": {
- "name": "condition_match_mode",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'all'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rules_organization_id_organizations_id_fk": {
- "name": "tagging_rules_organization_id_organizations_id_fk",
- "tableFrom": "tagging_rules",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_deliveries": {
- "name": "webhook_deliveries",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "request_payload": {
- "name": "request_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_payload": {
- "name": "response_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_status": {
- "name": "response_status",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhook_deliveries_webhook_id_webhooks_id_fk": {
- "name": "webhook_deliveries_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_deliveries",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_events": {
- "name": "webhook_events",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "webhook_events_webhook_id_event_name_unique": {
- "name": "webhook_events_webhook_id_event_name_unique",
- "columns": [
- "webhook_id",
- "event_name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "webhook_events_webhook_id_webhooks_id_fk": {
- "name": "webhook_events_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_events",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhooks": {
- "name": "webhooks",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "url": {
- "name": "url",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "secret": {
- "name": "secret",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhooks_created_by_users_id_fk": {
- "name": "webhooks_created_by_users_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "webhooks_organization_id_organizations_id_fk": {
- "name": "webhooks_organization_id_organizations_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/0012_snapshot.json b/apps/papra-server/src/migrations/meta/0012_snapshot.json
deleted file mode 100644
index a234a617..00000000
--- a/apps/papra-server/src/migrations/meta/0012_snapshot.json
+++ /dev/null
@@ -1,2170 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "1d039177-2d51-403b-a8b4-8cc37f65aef1",
- "prevId": "7407bb9b-b179-4a4c-89c6-ac869979f836",
- "tables": {
- "document_activity_log": {
- "name": "document_activity_log",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event": {
- "name": "event",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_data": {
- "name": "event_data",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "document_activity_log_document_id_documents_id_fk": {
- "name": "document_activity_log_document_id_documents_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "document_activity_log_user_id_users_id_fk": {
- "name": "document_activity_log_user_id_users_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "document_activity_log_tag_id_tags_id_fk": {
- "name": "document_activity_log_tag_id_tags_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- },
- "file_encryption_key_wrapped": {
- "name": "file_encryption_key_wrapped",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "file_encryption_kek_version": {
- "name": "file_encryption_kek_version",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "file_encryption_algorithm": {
- "name": "file_encryption_algorithm",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- },
- "documents_file_encryption_kek_version_index": {
- "name": "documents_file_encryption_kek_version_index",
- "columns": [
- "file_encryption_kek_version"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'pending'"
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_invitations_organization_email_unique": {
- "name": "organization_invitations_organization_email_unique",
- "columns": [
- "organization_id",
- "email"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scheduled_purge_at": {
- "name": "scheduled_purge_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "organizations_deleted_at_purge_at_index": {
- "name": "organizations_deleted_at_purge_at_index",
- "columns": [
- "deleted_at",
- "scheduled_purge_at"
- ],
- "isUnique": false
- },
- "organizations_deleted_by_deleted_at_index": {
- "name": "organizations_deleted_by_deleted_at_index",
- "columns": [
- "deleted_by",
- "deleted_at"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "organizations_deleted_by_users_id_fk": {
- "name": "organizations_deleted_by_users_id_fk",
- "tableFrom": "organizations",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_name_unique": {
- "name": "tags_organization_id_name_unique",
- "columns": [
- "organization_id",
- "name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "two_factor_enabled": {
- "name": "two_factor_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_key_organizations": {
- "name": "api_key_organizations",
- "columns": {
- "api_key_id": {
- "name": "api_key_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_member_id": {
- "name": "organization_member_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "api_key_organizations_api_key_id_api_keys_id_fk": {
- "name": "api_key_organizations_api_key_id_api_keys_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "api_keys",
- "columnsFrom": [
- "api_key_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "api_key_organizations_organization_member_id_organization_members_id_fk": {
- "name": "api_key_organizations_organization_member_id_organization_members_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "organization_members",
- "columnsFrom": [
- "organization_member_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_keys": {
- "name": "api_keys",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "key_hash": {
- "name": "key_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "prefix": {
- "name": "prefix",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "last_used_at": {
- "name": "last_used_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "all_organizations": {
- "name": "all_organizations",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "api_keys_key_hash_unique": {
- "name": "api_keys_key_hash_unique",
- "columns": [
- "key_hash"
- ],
- "isUnique": true
- },
- "key_hash_index": {
- "name": "key_hash_index",
- "columns": [
- "key_hash"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "api_keys_user_id_users_id_fk": {
- "name": "api_keys_user_id_users_id_fk",
- "tableFrom": "api_keys",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "organizations",
- "columnsFrom": [
- "active_organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_two_factor": {
- "name": "auth_two_factor",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "secret": {
- "name": "secret",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "backup_codes": {
- "name": "backup_codes",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_two_factor_user_id_users_id_fk": {
- "name": "auth_two_factor_user_id_users_id_fk",
- "tableFrom": "auth_two_factor",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_fts": {
- "name": "documents_fts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_actions": {
- "name": "tagging_rule_actions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "tagging_rule_actions_tag_id_tags_id_fk": {
- "name": "tagging_rule_actions_tag_id_tags_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_conditions": {
- "name": "tagging_rule_conditions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "field": {
- "name": "field",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "operator": {
- "name": "operator",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_case_sensitive": {
- "name": "is_case_sensitive",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_conditions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rules": {
- "name": "tagging_rules",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "condition_match_mode": {
- "name": "condition_match_mode",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'all'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rules_organization_id_organizations_id_fk": {
- "name": "tagging_rules_organization_id_organizations_id_fk",
- "tableFrom": "tagging_rules",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_deliveries": {
- "name": "webhook_deliveries",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "request_payload": {
- "name": "request_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_payload": {
- "name": "response_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_status": {
- "name": "response_status",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhook_deliveries_webhook_id_webhooks_id_fk": {
- "name": "webhook_deliveries_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_deliveries",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_events": {
- "name": "webhook_events",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "webhook_events_webhook_id_event_name_unique": {
- "name": "webhook_events_webhook_id_event_name_unique",
- "columns": [
- "webhook_id",
- "event_name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "webhook_events_webhook_id_webhooks_id_fk": {
- "name": "webhook_events_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_events",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhooks": {
- "name": "webhooks",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "url": {
- "name": "url",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "secret": {
- "name": "secret",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhooks_created_by_users_id_fk": {
- "name": "webhooks_created_by_users_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "webhooks_organization_id_organizations_id_fk": {
- "name": "webhooks_organization_id_organizations_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {}
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/0013_snapshot.json b/apps/papra-server/src/migrations/meta/0013_snapshot.json
deleted file mode 100644
index 66515ada..00000000
--- a/apps/papra-server/src/migrations/meta/0013_snapshot.json
+++ /dev/null
@@ -1,2179 +0,0 @@
-{
- "version": "6",
- "dialect": "sqlite",
- "id": "ece740d3-7960-41e9-a8a0-57e61d291f39",
- "prevId": "1d039177-2d51-403b-a8b4-8cc37f65aef1",
- "tables": {
- "document_activity_log": {
- "name": "document_activity_log",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event": {
- "name": "event",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_data": {
- "name": "event_data",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "document_activity_log_document_id_documents_id_fk": {
- "name": "document_activity_log_document_id_documents_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "document_activity_log_user_id_users_id_fk": {
- "name": "document_activity_log_user_id_users_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "document_activity_log_tag_id_tags_id_fk": {
- "name": "document_activity_log_tag_id_tags_id_fk",
- "tableFrom": "document_activity_log",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents": {
- "name": "documents",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "original_name": {
- "name": "original_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_size": {
- "name": "original_size",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": 0
- },
- "original_storage_key": {
- "name": "original_storage_key",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "original_sha256_hash": {
- "name": "original_sha256_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "mime_type": {
- "name": "mime_type",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "''"
- },
- "file_encryption_key_wrapped": {
- "name": "file_encryption_key_wrapped",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "file_encryption_kek_version": {
- "name": "file_encryption_kek_version",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "file_encryption_algorithm": {
- "name": "file_encryption_algorithm",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "is_deleted": {
- "name": "is_deleted",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "documents_organization_id_is_deleted_created_at_index": {
- "name": "documents_organization_id_is_deleted_created_at_index",
- "columns": [
- "organization_id",
- "is_deleted",
- "created_at"
- ],
- "isUnique": false
- },
- "documents_organization_id_is_deleted_index": {
- "name": "documents_organization_id_is_deleted_index",
- "columns": [
- "organization_id",
- "is_deleted"
- ],
- "isUnique": false
- },
- "documents_organization_id_original_sha256_hash_unique": {
- "name": "documents_organization_id_original_sha256_hash_unique",
- "columns": [
- "organization_id",
- "original_sha256_hash"
- ],
- "isUnique": true
- },
- "documents_original_sha256_hash_index": {
- "name": "documents_original_sha256_hash_index",
- "columns": [
- "original_sha256_hash"
- ],
- "isUnique": false
- },
- "documents_organization_id_size_index": {
- "name": "documents_organization_id_size_index",
- "columns": [
- "organization_id",
- "original_size"
- ],
- "isUnique": false
- },
- "documents_file_encryption_kek_version_index": {
- "name": "documents_file_encryption_kek_version_index",
- "columns": [
- "file_encryption_kek_version"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "documents_organization_id_organizations_id_fk": {
- "name": "documents_organization_id_organizations_id_fk",
- "tableFrom": "documents",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_created_by_users_id_fk": {
- "name": "documents_created_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "documents_deleted_by_users_id_fk": {
- "name": "documents_deleted_by_users_id_fk",
- "tableFrom": "documents",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_invitations": {
- "name": "organization_invitations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'pending'"
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "inviter_id": {
- "name": "inviter_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_invitations_organization_email_unique": {
- "name": "organization_invitations_organization_email_unique",
- "columns": [
- "organization_id",
- "email"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_invitations_organization_id_organizations_id_fk": {
- "name": "organization_invitations_organization_id_organizations_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_invitations_inviter_id_users_id_fk": {
- "name": "organization_invitations_inviter_id_users_id_fk",
- "tableFrom": "organization_invitations",
- "tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_members": {
- "name": "organization_members",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "organization_members_user_organization_unique": {
- "name": "organization_members_user_organization_unique",
- "columns": [
- "organization_id",
- "user_id"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "organization_members_organization_id_organizations_id_fk": {
- "name": "organization_members_organization_id_organizations_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "organization_members_user_id_users_id_fk": {
- "name": "organization_members_user_id_users_id_fk",
- "tableFrom": "organization_members",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organizations": {
- "name": "organizations",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_at": {
- "name": "deleted_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "deleted_by": {
- "name": "deleted_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scheduled_purge_at": {
- "name": "scheduled_purge_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "organizations_deleted_at_purge_at_index": {
- "name": "organizations_deleted_at_purge_at_index",
- "columns": [
- "deleted_at",
- "scheduled_purge_at"
- ],
- "isUnique": false
- },
- "organizations_deleted_by_deleted_at_index": {
- "name": "organizations_deleted_by_deleted_at_index",
- "columns": [
- "deleted_by",
- "deleted_at"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "organizations_deleted_by_users_id_fk": {
- "name": "organizations_deleted_by_users_id_fk",
- "tableFrom": "organizations",
- "tableTo": "users",
- "columnsFrom": [
- "deleted_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "user_roles": {
- "name": "user_roles",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "role": {
- "name": "role",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "user_roles_role_index": {
- "name": "user_roles_role_index",
- "columns": [
- "role"
- ],
- "isUnique": false
- },
- "user_roles_user_id_role_unique_index": {
- "name": "user_roles_user_id_role_unique_index",
- "columns": [
- "user_id",
- "role"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "user_roles_user_id_users_id_fk": {
- "name": "user_roles_user_id_users_id_fk",
- "tableFrom": "user_roles",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_tags": {
- "name": "documents_tags",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "documents_tags_document_id_documents_id_fk": {
- "name": "documents_tags_document_id_documents_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "documents_tags_tag_id_tags_id_fk": {
- "name": "documents_tags_tag_id_tags_id_fk",
- "tableFrom": "documents_tags",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {
- "documents_tags_pkey": {
- "columns": [
- "document_id",
- "tag_id"
- ],
- "name": "documents_tags_pkey"
- }
- },
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tags": {
- "name": "tags",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "normalized_name": {
- "name": "normalized_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "color": {
- "name": "color",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "tags_organization_id_normalized_name_unique": {
- "name": "tags_organization_id_normalized_name_unique",
- "columns": [
- "organization_id",
- "normalized_name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "tags_organization_id_organizations_id_fk": {
- "name": "tags_organization_id_organizations_id_fk",
- "tableFrom": "tags",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "users": {
- "name": "users",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email": {
- "name": "email",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_verified": {
- "name": "email_verified",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "image": {
- "name": "image",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "max_organization_count": {
- "name": "max_organization_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "two_factor_enabled": {
- "name": "two_factor_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "users_email_unique": {
- "name": "users_email_unique",
- "columns": [
- "email"
- ],
- "isUnique": true
- },
- "users_email_index": {
- "name": "users_email_index",
- "columns": [
- "email"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_key_organizations": {
- "name": "api_key_organizations",
- "columns": {
- "api_key_id": {
- "name": "api_key_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_member_id": {
- "name": "organization_member_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "api_key_organizations_api_key_id_api_keys_id_fk": {
- "name": "api_key_organizations_api_key_id_api_keys_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "api_keys",
- "columnsFrom": [
- "api_key_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "api_key_organizations_organization_member_id_organization_members_id_fk": {
- "name": "api_key_organizations_organization_member_id_organization_members_id_fk",
- "tableFrom": "api_key_organizations",
- "tableTo": "organization_members",
- "columnsFrom": [
- "organization_member_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "api_keys": {
- "name": "api_keys",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "key_hash": {
- "name": "key_hash",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "prefix": {
- "name": "prefix",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "last_used_at": {
- "name": "last_used_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "permissions": {
- "name": "permissions",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "all_organizations": {
- "name": "all_organizations",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {
- "api_keys_key_hash_unique": {
- "name": "api_keys_key_hash_unique",
- "columns": [
- "key_hash"
- ],
- "isUnique": true
- },
- "key_hash_index": {
- "name": "key_hash_index",
- "columns": [
- "key_hash"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "api_keys_user_id_users_id_fk": {
- "name": "api_keys_user_id_users_id_fk",
- "tableFrom": "api_keys",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_accounts": {
- "name": "auth_accounts",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "account_id": {
- "name": "account_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "provider_id": {
- "name": "provider_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "access_token": {
- "name": "access_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token": {
- "name": "refresh_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "access_token_expires_at": {
- "name": "access_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "refresh_token_expires_at": {
- "name": "refresh_token_expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "scope": {
- "name": "scope",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "id_token": {
- "name": "id_token",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "password": {
- "name": "password",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_accounts_user_id_users_id_fk": {
- "name": "auth_accounts_user_id_users_id_fk",
- "tableFrom": "auth_accounts",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_sessions": {
- "name": "auth_sessions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "token": {
- "name": "token",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "ip_address": {
- "name": "ip_address",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "user_agent": {
- "name": "user_agent",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "active_organization_id": {
- "name": "active_organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_sessions_token_index": {
- "name": "auth_sessions_token_index",
- "columns": [
- "token"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {
- "auth_sessions_user_id_users_id_fk": {
- "name": "auth_sessions_user_id_users_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "auth_sessions_active_organization_id_organizations_id_fk": {
- "name": "auth_sessions_active_organization_id_organizations_id_fk",
- "tableFrom": "auth_sessions",
- "tableTo": "organizations",
- "columnsFrom": [
- "active_organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_two_factor": {
- "name": "auth_two_factor",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "user_id": {
- "name": "user_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "secret": {
- "name": "secret",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "backup_codes": {
- "name": "backup_codes",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "auth_two_factor_user_id_users_id_fk": {
- "name": "auth_two_factor_user_id_users_id_fk",
- "tableFrom": "auth_two_factor",
- "tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "auth_verifications": {
- "name": "auth_verifications",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "identifier": {
- "name": "identifier",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "expires_at": {
- "name": "expires_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "auth_verifications_identifier_index": {
- "name": "auth_verifications_identifier_index",
- "columns": [
- "identifier"
- ],
- "isUnique": false
- }
- },
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "documents_fts": {
- "name": "documents_fts",
- "columns": {
- "document_id": {
- "name": "document_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "content": {
- "name": "content",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {},
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "intake_emails": {
- "name": "intake_emails",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "email_address": {
- "name": "email_address",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "allowed_origins": {
- "name": "allowed_origins",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'[]'"
- },
- "is_enabled": {
- "name": "is_enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- }
- },
- "indexes": {
- "intake_emails_email_address_unique": {
- "name": "intake_emails_email_address_unique",
- "columns": [
- "email_address"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "intake_emails_organization_id_organizations_id_fk": {
- "name": "intake_emails_organization_id_organizations_id_fk",
- "tableFrom": "intake_emails",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "organization_subscriptions": {
- "name": "organization_subscriptions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "customer_id": {
- "name": "customer_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "plan_id": {
- "name": "plan_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "status": {
- "name": "status",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "seats_count": {
- "name": "seats_count",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_end": {
- "name": "current_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "current_period_start": {
- "name": "current_period_start",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "cancel_at_period_end": {
- "name": "cancel_at_period_end",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "organization_subscriptions_organization_id_organizations_id_fk": {
- "name": "organization_subscriptions_organization_id_organizations_id_fk",
- "tableFrom": "organization_subscriptions",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_actions": {
- "name": "tagging_rule_actions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tag_id": {
- "name": "tag_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_actions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- },
- "tagging_rule_actions_tag_id_tags_id_fk": {
- "name": "tagging_rule_actions_tag_id_tags_id_fk",
- "tableFrom": "tagging_rule_actions",
- "tableTo": "tags",
- "columnsFrom": [
- "tag_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rule_conditions": {
- "name": "tagging_rule_conditions",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "tagging_rule_id": {
- "name": "tagging_rule_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "field": {
- "name": "field",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "operator": {
- "name": "operator",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "value": {
- "name": "value",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "is_case_sensitive": {
- "name": "is_case_sensitive",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk": {
- "name": "tagging_rule_conditions_tagging_rule_id_tagging_rules_id_fk",
- "tableFrom": "tagging_rule_conditions",
- "tableTo": "tagging_rules",
- "columnsFrom": [
- "tagging_rule_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "tagging_rules": {
- "name": "tagging_rules",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "description": {
- "name": "description",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "condition_match_mode": {
- "name": "condition_match_mode",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": "'all'"
- }
- },
- "indexes": {},
- "foreignKeys": {
- "tagging_rules_organization_id_organizations_id_fk": {
- "name": "tagging_rules_organization_id_organizations_id_fk",
- "tableFrom": "tagging_rules",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_deliveries": {
- "name": "webhook_deliveries",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "request_payload": {
- "name": "request_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_payload": {
- "name": "response_payload",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "response_status": {
- "name": "response_status",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhook_deliveries_webhook_id_webhooks_id_fk": {
- "name": "webhook_deliveries_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_deliveries",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhook_events": {
- "name": "webhook_events",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "webhook_id": {
- "name": "webhook_id",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "event_name": {
- "name": "event_name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- }
- },
- "indexes": {
- "webhook_events_webhook_id_event_name_unique": {
- "name": "webhook_events_webhook_id_event_name_unique",
- "columns": [
- "webhook_id",
- "event_name"
- ],
- "isUnique": true
- }
- },
- "foreignKeys": {
- "webhook_events_webhook_id_webhooks_id_fk": {
- "name": "webhook_events_webhook_id_webhooks_id_fk",
- "tableFrom": "webhook_events",
- "tableTo": "webhooks",
- "columnsFrom": [
- "webhook_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- },
- "webhooks": {
- "name": "webhooks",
- "columns": {
- "id": {
- "name": "id",
- "type": "text",
- "primaryKey": true,
- "notNull": true,
- "autoincrement": false
- },
- "created_at": {
- "name": "created_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "updated_at": {
- "name": "updated_at",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "name": {
- "name": "name",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "url": {
- "name": "url",
- "type": "text",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
- },
- "secret": {
- "name": "secret",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "enabled": {
- "name": "enabled",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false,
- "default": true
- },
- "created_by": {
- "name": "created_by",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- },
- "organization_id": {
- "name": "organization_id",
- "type": "text",
- "primaryKey": false,
- "notNull": false,
- "autoincrement": false
- }
- },
- "indexes": {},
- "foreignKeys": {
- "webhooks_created_by_users_id_fk": {
- "name": "webhooks_created_by_users_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "set null",
- "onUpdate": "cascade"
- },
- "webhooks_organization_id_organizations_id_fk": {
- "name": "webhooks_organization_id_organizations_id_fk",
- "tableFrom": "webhooks",
- "tableTo": "organizations",
- "columnsFrom": [
- "organization_id"
- ],
- "columnsTo": [
- "id"
- ],
- "onDelete": "cascade",
- "onUpdate": "cascade"
- }
- },
- "compositePrimaryKeys": {},
- "uniqueConstraints": {},
- "checkConstraints": {}
- }
- },
- "views": {},
- "enums": {},
- "_meta": {
- "schemas": {},
- "tables": {},
- "columns": {
- "\"documents_fts\".\"id\"": "\"documents_fts\".\"document_id\""
- }
- },
- "internal": {
- "indexes": {}
- }
-}
diff --git a/apps/papra-server/src/migrations/meta/_journal.json b/apps/papra-server/src/migrations/meta/_journal.json
deleted file mode 100644
index 7949963e..00000000
--- a/apps/papra-server/src/migrations/meta/_journal.json
+++ /dev/null
@@ -1,104 +0,0 @@
-{
- "version": "7",
- "dialect": "sqlite",
- "entries": [
- {
- "idx": 0,
- "version": "6",
- "when": 1743508385578,
- "tag": "0000_initial_schema_setup",
- "breakpoints": true
- },
- {
- "idx": 1,
- "version": "6",
- "when": 1743508401881,
- "tag": "0001_documents_fts",
- "breakpoints": true
- },
- {
- "idx": 2,
- "version": "6",
- "when": 1743938048080,
- "tag": "0002_tagging_rules",
- "breakpoints": true
- },
- {
- "idx": 3,
- "version": "6",
- "when": 1745131802627,
- "tag": "0003_api-keys",
- "breakpoints": true
- },
- {
- "idx": 4,
- "version": "6",
- "when": 1746297779495,
- "tag": "0004_organizations-webhooks",
- "breakpoints": true
- },
- {
- "idx": 5,
- "version": "6",
- "when": 1747575029264,
- "tag": "0005_organizations-invitations-improvement",
- "breakpoints": true
- },
- {
- "idx": 6,
- "version": "6",
- "when": 1748554484124,
- "tag": "0006_document-activity-log",
- "breakpoints": true
- },
- {
- "idx": 7,
- "version": "6",
- "when": 1754086182584,
- "tag": "0007_document-activity-log-on-delete-set-null",
- "breakpoints": true
- },
- {
- "idx": 8,
- "version": "6",
- "when": 1756332437565,
- "tag": "0008_document-file-encryption",
- "breakpoints": true
- },
- {
- "idx": 9,
- "version": "6",
- "when": 1756332955747,
- "tag": "0009_document-file-encryption",
- "breakpoints": true
- },
- {
- "idx": 10,
- "version": "6",
- "when": 1760016118956,
- "tag": "0010_soft-delete-organizations",
- "breakpoints": true
- },
- {
- "idx": 11,
- "version": "6",
- "when": 1761645190314,
- "tag": "0011_tagging-rule-condition-match-mode",
- "breakpoints": true
- },
- {
- "idx": 12,
- "version": "6",
- "when": 1766411483931,
- "tag": "0012_two-factor-authentication",
- "breakpoints": true
- },
- {
- "idx": 13,
- "version": "6",
- "when": 1769523160483,
- "tag": "0013_case-insensitive-tag-name-uniq-constraint",
- "breakpoints": true
- }
- ]
-}