Introducing a new way to review your PRs.

Read the announcement

capsoftware / cap

Open source Loom alternative. Beautiful, shareable screen recordings.

View on GitHub

31 documents · Updated Nov 23, 2026

docs / database-schema-and-migrations

Database schema and migrations

The database package is the shared data layer for Cap’s users, organizations, captured videos, storage links, collaboration records, API products, and developer media services. It gives application services one MySQL schema, one query entry point, and a controlled path for changing live data over time. See the Data and identity platform page for the wider persistence and identity model.

Database package boundary

The package defines the durable records used by the product and exposes them to server-side services through Drizzle ORM. Domain types from packages/web-domain/src and JSON field types in packages/…/metadata.ts keep key database values aligned with the rest of the system.

The main boundary is:

  • Schema model: packages/…/schema.ts describes MySQL tables, keys, indexes, and relations.
  • Runtime access: packages/…/index.ts creates and caches the database client.
  • Identity access: packages/database/auth connects NextAuth sessions and providers to the user and organization records.
  • Schema change path: packages/…/migrate.ts applies ordered migrations and required data backfills.
  • Operational tools: the package scripts expose schema generation, database synchronization, checks, inspection, and migration-integrity checks.

Schema model

The schema models Cap as a tenant-aware content system. A user belongs to organizations and spaces. Videos and related records carry ownership or organization context so application services can enforce access and present content in the right workspace.

Identity and tenant data

Identity data connects a person to sign-in methods, sessions, organizations, invitations, membership roles, and organization SSO billing. An organization is the main tenant boundary. Spaces provide another level for organizing and sharing content inside an organization.

User records also retain a small marketingOrigin value. This records the known source of a signup while keeping the user’s identity and tenant relationships separate from acquisition data.

The main relationships are:

Business areaData relationshipSystem purpose
Sign-inUser, linked account, session, and verification tokenSupports provider sign-in and email-code sign-in.
OrganizationOrganization, owner, member, and inviteEstablishes ownership and controlled membership.
Enterprise sign-inOrganization SSO record and WorkOS organization IDTracks SSO access for an organization and links it to the external identity service.
SpaceSpace, space member, and space videoGroups content for workspace use and sharing.
IntegrationOrganization installation and installerRecords an external integration that an organization has enabled.

References: packages/…/schema.ts• L82-159 packages/…/schema.ts• L216-379 packages/…/schema.ts• L1208-1340 packages/…/drizzle-adapter.ts• L71-153 packages/…/0041_saml_sso.sql• L1-22

Content and collaboration data

Video records are the center of the captured-content model. They hold ownership, organization, folder, visibility, source, media properties, processing state, and product metadata. Video settings also support presentation controls such as playback behavior and call-to-action content. Separate records describe edits, shared copies, comments, notifications, and upload progress so each concern can change without changing the core video record.

Folders form a tree. Spaces and shared-video records connect videos to organization-level views. Space-video records can also retain an optional position so a space can present a custom library order. Comments can form reply trees and can point to media stored with a video. JSON metadata carries flexible product state such as generated titles, summaries, chapters, and live transcript status.

The video model also records an optional archive time. Organization, owner, folder, archive, and effective-creation lookup support lets library views separate archived content from active content while keeping the product’s effective content order.

The schema also supports targeted viewer access. An organization can store a default private video-visibility setting, while video_viewer_grants records email-based access for a video. Each grant keeps its inviter and creation time, supports later revocation, and allows only one grant for a given video and email pair. Deleting the video removes its grants.

Notification records now also have a direct video index. This supports lookups for notifications linked to one video without changing the notification data contract. Upload records also have a start-time index, and videos have a combined organization, owner, folder, archive, and effective-creation index for tenant content queries and ordered views.

References: packages/…/schema.ts• L381-595 packages/…/schema.ts• L597-748 packages/…/schema.ts• L1492-1625 packages/…/schema.ts• L1342-1383 packages/…/schema.ts• L1385-1516 packages/…/schema.ts• L1543-1579 packages/…/metadata.ts• L8-64 packages/…/0049_jittery_professor_monster.sql• L1-13 packages/…/0051_fancy_talkback.sql• L1-3 packages/…/0062_dashboard_library_tools.sql• L1-3

Loom migration data

The schema records customer requests to move video workspaces from Loom into Cap. A migration request stores the organization, requester, customer and operator notes, progress counts, status, lease state, and completion time. A separate import ledger records each imported video once, so the migration process can track work without importing the same video twice.

The active-organization key prevents more than one active request from claiming the same target organization. Request and status indexes support organization history and operational queues. The video key in the import ledger provides the deduplication boundary for imported content.

References: packages/…/schema.ts• L1639-1721 packages/…/0050_loom_concierge.sql• L1-36

Storage and processing data

Storage records separate a configured storage service from the objects stored in it. A storage integration belongs to a user or organization. Storage objects track the provider identity, object key, upload state, and optional video link. S3 bucket records support product-managed or custom bucket settings.

Upload records track the progress of bringing a video into the system. Processing job records add a durable work state for each video. They keep the processing generation, lease, retry time, remote job identifiers, output, and error state so workers can resume or retry work without losing their place. Processing budget records track reserved media capacity until a time limit. Imported-video records prevent the same external source item from being imported more than once for an organization.

References: packages/…/schema.ts• L812-936 packages/…/schema.ts• L1536-1653 packages/…/schema.ts• L1232-1267 packages/…/0040_recording_jobs.sql• L1-24

API and product extension data

The schema also supports external API use and product-level extensions. Agent API records cover user keys, short-lived authorization codes, request idempotency, and long-running operations. Developer application records cover app domains, API keys, developer-owned videos, transcripts, credit balances, credit transactions, daily storage snapshots, webhook endpoints, imports, and delivery metering.

Developer videos preserve the state of an app-owned media item from upload through playback and cleanup. They can retain a playback identity, a resolution limit, available renditions, stored size, processing state, an error reason, and a storage-paid-until time. A separate developer transcript record carries a source, processing state, result text, language data, timestamps, and reserved or billed credits. It can link a request to a developer video and record when that request was made. These records let the developer service report media work and cost without mixing it with the main user video model.

Developer webhook endpoints connect an app to event delivery. They keep an encrypted signing secret, subscribed events, enabled state, soft-delete state, and recent delivery health so the service can deliver events and disable failing destinations without losing the endpoint record. Developer video imports keep the source URL, API key context, import state, byte count, and completion or error time for each video. The video key gives the import one durable identity.

Delivery metering stores daily usage for each app and delivery tier. It records seconds, bytes, requests, abandoned bytes, and whether a day is final. A separate log-file ledger records the source file identity, tag, hour, parts, and processing time so usage work can avoid processing the same log file twice.

The MCP OAuth records extend this model to external MCP clients. Client rows store a client identity and its redirect addresses. Authorization-code rows bind a user and client to a short-lived code. Token rows store hashed access and refresh credentials with expiry, revocation, resource, and token-family state. The model keeps credential values out of the database while preserving lookup and revocation paths.

The client lifecycle uses an optional activation time. This separates registered clients that have not completed activation from clients that can take part in the active flow. A registration-quota row stores a count for a time window and its expiry. Together with expiry indexes, these records support cleanup and limit checks for client registration.

These records preserve state across requests and workers. Expiry, revocation, unique hashes, operation state, and transaction references allow services to reject stale credentials and avoid repeating billable or mutating work. Credit-account, transcript, storage, webhook, import, and delivery indexes support owner, reference, completed-work, held-credit, endpoint, import-state, and metering reads as the developer service reconciles usage.

References: packages/…/schema.ts• L1008-1244 packages/…/schema.ts• L1873-2046 packages/…/schema.ts• L2173-2313 packages/…/0046_mcp_oauth.sql• L1-46 packages/…/0047_mcp_client_lifecycle.sql• L1-2 packages/…/0048_mcp_registration_quota.sql• L1-9 packages/…/0054_developer_video_playback.sql• L1-12 packages/…/0055_developer_transcripts.sql• L1-36 packages/…/0056_developer_billing_read_indexes.sql• L1-4 packages/…/0057_developer_transcript_video.sql• L1-3 packages/…/0058_developer_webhook_endpoints.sql• L1-23 packages/…/0059_developer_video_first_month.sql• L1-3 packages/…/0060_developer_video_imports.sql• L1-17 packages/…/0061_developer_delivery_metering.sql• L1-26

Mobile push data

Mobile push data connects a user’s mobile device to notification delivery while keeping device registration tied to an authenticated session. mobile_push_tokens stores the device token, mobile environment, and a hash of the registering API-key session. A unique token prevents one device token from being registered more than once, while user and session indexes support cleanup and delivery lookup.

mobile_push_claims records delivery claims that must happen at most once for a defined event window. Its time index supports later cleanup of old claims. Together, these tables separate reusable device registration from the short-lived idempotency state used to avoid duplicate pushes.

References: packages/…/schema.ts• L1022-1053 packages/…/0053_mobile_push_tokens.sql• L1-21 packages/…/0053_snapshot.json• L2768-2885

Lifecycle sync data

The loops_sync_jobs table stores one durable synchronization job for each user. It gives lifecycle automation a due time, a lease, retry counts, the last error, and the last known profile and email values. The optional teammateJoinedAt value records the point at which the related teammate event is known.

The table’s user-keyed row prevents multiple job records for one user. Its due-time index supports selection of work that is ready to run. The customer lifecycle automation page describes the wider process that uses this state.

References: packages/…/schema.ts• L145-163 packages/…/0044_awesome_sugar_man.sql• L1-16 packages/…/0045_steep_forge.sql• L1

Directory synchronization data

Directory synchronization data connects an organization’s external directory entries to Cap users. directory_users keeps the directory identity, matched user, email, and active state. organization_directory_sync keeps one organization-level record for sync requests, completed syncs, leases, errors, and removal approval state.

The organization and user-organization indexes support tenant membership views and user lookups. The organization key on the sync record gives each organization one shared synchronization state rather than separate competing records.

References: packages/…/0052_directory_sync.sql• L1-27 packages/…/0052_snapshot.json• L1421-1506

Relationship and type contracts

Relations describe how services load connected records, while indexes support the access paths used by ownership, organization, time, state, and external-key queries. The schema also uses typed IDs, constrained status values, and typed JSON fields to make invalid cross-domain values harder to pass between services.

Sensitive fields are marked as encrypted text at the schema boundary. The database encryption key is supplied by server configuration, so a database row alone is not intended to be enough to recover protected values.

References: packages/…/schema.ts• L37-80 packages/…/schema.ts• L1208-1383 packages/…/schema.ts• L1573-1637 packages/…/crypto.ts• L6-37 packages/…/server.ts• L16-27

Migration lifecycle

Schema evolution is an ordered change process. Engineers update the Drizzle schema, generate a new SQL migration, keep the migration journal in order, and let the runtime migration entry point apply the pending changes before the self-hosted web service serves traffic.

Schema change flow

The diagram shows how a schema edit becomes a database change and how the repository checks the migration history.

flowchart LR
    A[Update schema model] --> B[Generate SQL migration]
    B --> C[Append migration journal entry]
    C --> D[Review migration files]
    D --> E[Apply pending migrations]
    E --> F[Database matches schema]
    C --> G[Validate journal history]
    G --> D

Drizzle Kit reads schema.ts and writes SQL files plus metadata under packages/database/migrations. The journal is append-only: the validation workflow rejects changes that alter the dialect, version, existing entries, or entry order. Migrations 0044 and 0045 add lifecycle synchronization state and a user marketing-origin field. Migrations 0046 through 0048 add MCP OAuth state, client activation state, and registration quota state. Migration 0049 adds video viewer grants and an organization default visibility field. Migration 0050 adds Loom migration requests and an import ledger. Migration 0051 adds indexes for video-linked notifications, upload start times, and organization content ordering. Migration 0052 adds organization directory synchronization state and directory-user mappings. Migration 0053 adds mobile push device registrations and at-most-once delivery claims. Migrations 0054 through 0056 extend developer video playback state, add developer transcript records, and add read indexes for developer billing and transcript work. Migrations 0057 through 0061 link transcripts to developer videos, add webhook endpoints, add first-month storage billing state, add developer video imports, and add daily delivery metering with log-file processing state. Migration 0062 adds space-video positions, video archive state, and an index for archive-aware library ordering. The generated snapshots preserve this sequence through the latest schema state.

References: packages/…/drizzle.config.ts• L1-18 packages/…/package.json• L7-16 packages/…/_journal.json• L433-445 packages/…/0062_snapshot.json• L4877-4967 packages/…/0062_snapshot.json• L6159-6322 packages/…/0062_dashboard_library_tools.sql• L1-3 .github/…/validate-migration-journal.yml• L17-76

Data backfills

Some changes need both a structural update and a data repair. The migration runner handles this by retrying the videos.orgId constraint change after it fills missing organization IDs from the owners’ active organizations. It then normalizes stored space member roles.

The organization backfill processes videos in chunks and reports initial, final, and mismatch counts. If the required backfill still cannot make videos.orgId non-null, migration stops with an explicit manual-repair error instead of hiding the incomplete state.

References: packages/…/migrate.ts• L9-46 packages/…/orgid_backfill.ts• L5-25 packages/…/orgid_backfill.ts• L76-194 packages/…/space_member_role_backfill.ts• L5-10

Deployment startup

The web service runs migrateDb during startup only for Docker or self-hosted builds. It waits briefly, retries failed migration attempts, and exits after the retry limit. This startup path is not suitable for serverless request processes because repeated instance starts could run operational database work at request scale.

References: apps/…/instrumentation.node.ts• L1-40 apps/…/instrumentation.node.ts• L86-100

Configuration and query access

The database client requires DATABASE_URL and accepts only a mysql:// connection string. The same value configures Drizzle Kit, while local Docker setups and deployed infrastructure provide environment-specific MySQL URLs.

The client is created lazily and cached for the process. It is instrumented when created, so application queries share the database package’s tracing boundary. updateIfDefined provides a shared update expression that changes a column only when a new value is present.

References: packages/…/index.ts• L6-29 packages/…/drizzle.config.ts• L3-17 packages/…/server.ts• L12-27 docker-compose.yml• L1-20 infra/sst.config.ts• L340-350

Authentication data access

NextAuth uses the database package as its adapter for users, linked accounts, sessions, and verification tokens. New users may join an existing invited organization or receive a new organization and owner membership. Email values are normalized before lookup, and configured signup-domain rules apply to new users.

The application uses JWT sessions, but session decoding checks the stored authentication session version. Increasing that version invalidates tokens that carry an older version. This makes the database user record part of the session invalidation contract.

References: packages/…/drizzle-adapter.ts• L32-71 packages/…/drizzle-adapter.ts• L73-153 packages/…/auth-options.ts• L24-46 packages/…/auth-options.ts• L185-262

Operational data management

The package provides separate paths for development, schema work, and deployed migration work. Development commands can push the current schema to a database. Change review and deployment should use generated, ordered migrations instead of treating a direct push as the history of record.

Entry pointPurpose
pnpm db:generateGenerate SQL and journal changes from the schema model.
pnpm db:pushSynchronize a database directly during development or setup.
pnpm --filter @cap/database db:checkCheck MySQL migration state through Drizzle Kit.
pnpm --filter @cap/database db:studioInspect and manage data through Drizzle Studio.
pnpm --filter @cap/database db:check-integrityRun the repository’s migration-integrity check.
migrateDb()Apply pending migrations and required backfills in a service startup path.

The root development task runs the database push task before persistent development tasks. The runtime migration path remains distinct because it applies the committed migration history and data repair steps.

References: packages/…/package.json• L7-16 packages/…/package.json• L58-69 package.json• L15-18 turbo.json• L57-67 packages/…/migrate.ts• L23-46

Change checklist

When these files or sections are changed, remember to consider these:

  • When a table, status value, ID type, or JSON field changes in schema.ts, check the matching domain type and every service that reads or writes that value.
  • When a nullable field becomes required, add or verify a data backfill before the constraint migration. Confirm that the runtime retry path still recognizes the intended migration query.
  • When a relation or access index changes, check organization, owner, state, and time-based query paths. These indexes are part of the expected query contract.
  • When a notification, upload, or video query gains a new access path, keep the corresponding index in schema.ts, the generated SQL, and the migration snapshot aligned.
  • When space library ordering or video archive state changes, keep position handling, archive filtering, effective-creation ordering, the composite video index, the generated SQL, and the snapshot aligned.
  • When mobile push registration or claim fields change, keep token uniqueness, session binding, environment values, delivery claim keys, and claim cleanup aligned with mobile notification delivery.
  • When an encrypted field changes, keep the database encryption key contract and all readers and writers aligned.
  • When processing job states, leases, retry times, or generations change, keep worker selection and retry behavior aligned with the state and lease indexes.
  • When loops_sync_jobs fields or its due-time index change, keep lifecycle job selection, lease handling, retry handling, and user-level uniqueness aligned with the table contract.
  • When directory membership or organization sync state changes, keep active membership checks, organization-level sync ownership, removal approval, lease handling, and the generated migration snapshot aligned.
  • When marketingOrigin changes, keep signup writers and downstream lifecycle or reporting readers aligned with its default and length limit.
  • When the organization SSO or WorkOS identity fields change, preserve the uniqueness rules and check existing external organization mappings for duplicates before deployment.
  • When MCP OAuth client, code, token, or quota fields change, keep expiry, hash uniqueness, activation state, token-family lookup, revocation checks, and registration-window limits aligned with their indexes.
  • When organization video visibility, viewer grants, or video presentation settings change, keep the default policy, email uniqueness, revocation checks, inviter data, and video-delete cascade aligned with sharing behavior.
  • When Loom migration request or import fields change, keep request status, active-organization uniqueness, lease expiry, progress counts, and video-level deduplication aligned with the migration worker and operator flows.
  • When developer video playback or transcript fields change, keep app ownership, media status transitions, cleanup timestamps, playback uniqueness, credit reservation, billing references, and worker read indexes aligned.
  • When developer transcript video links or request times change, keep app scoping, video ownership checks, request ordering, and transcript work reads aligned.
  • When developer webhook fields change, keep encrypted secret handling, event names, enabled and deleted states, failure counters, and delivery-health updates aligned.
  • When developer video storage or import fields change, keep first-month due selection, storage charging, import identity, source-key limits, and import state transitions aligned.
  • When delivery metering fields change, keep the app-day-tier key, delivery tier values, daily finalization, source log-file identity, and credit references aligned.
  • When a migration is generated, append its journal entry without editing prior entries. Run the migration-history validation before merge.
  • When startup migration behavior changes, check the deployment mode guard and avoid moving it into a serverless request path.

Important failure modes

TriggerConsequenceGuard
DATABASE_URL is missing or is not a mysql:// URLThe shared client or Drizzle Kit cannot start.Validate the URL before creating the client or generating migrations.
A required organization ID is added before old video rows are repairedThe schema migration fails on existing data.migrateDb runs the organization backfill and retries the migration.
The organization backfill leaves missing or mismatched IDsVideo ownership and tenant queries can use incomplete context.The backfill reports missing and mismatch counts and stops on a repeated constraint failure.
An existing migration journal entry is changed or removedDifferent environments can apply different histories.The pull-request workflow enforces an append-only journal.
A schema index is changed without its generated migration or snapshot updateThe live database can miss a required query path or migration history can drift from the schema.Generate the migration from schema.ts and validate the journal and snapshot before merge.
A space library stores no usable position while custom ordering is activeThe library can fall back to an unstable or unintended order.Treat the nullable position value and the space ordering mode as one contract.
Archive-aware library queries omit archivedAt or use an older index contractArchived videos can appear in active views or ordered library reads can degrade.Apply the archive filter and keep the archive-aware composite index in the schema and migration.
A migration is run from a serverless request lifecycleConcurrent or repeated instance starts can race on operational database work.Run startup migrations only in the Docker or self-hosted process path.
DATABASE_ENCRYPTION_KEY is absent or malformed when protected data is usedEncrypted values cannot be read or written.Require a valid 32-byte hex key through server configuration.
Existing organizations share a workosOrganizationId or SSO subscription ID when migration 0041 runsThe unique constraint cannot be created.Check and repair duplicate external mappings before applying the migration.
A processing job writer omits next_retry_atThe job row cannot be inserted because the retry schedule is required.Treat the retry time as part of the job creation contract.
A lifecycle sync writer omits nextAttemptAt or creates a second row for one userThe job cannot be scheduled or violates the user-keyed job contract.Require the due time and use the user ID as the single job key.
A directory entry is linked to the wrong organization or userDirectory membership can grant or remove access for the wrong tenant or person.Validate both organization and user identity when writing directory mappings.
Organization sync state is claimed without a valid lease or removal approvalConcurrent sync work can overlap or remove members without the required review.Treat the organization key, lease fields, removal count, and approval time as one sync-state contract.
A migration applies marketingOrigin with a value longer than the schema limitThe user update can fail or lose the intended source value.Normalize source values to the allowed length and preserve the unknown default.
A viewer grant uses a duplicate video and email pairThe grant cannot be inserted or updated as a second active record.Use the video-email unique key and update the existing grant when access changes.
A viewer grant is left active after access is revokedA user can keep access that the product intends to remove.Treat revokedAt as part of every viewer-access check.
A client, code, token, or quota row lacks its required expiry or unique hashStale credentials can remain usable, or lookup and rate-limit checks can fail.Treat expiry fields, hashed secrets, unique keys, activation state, and quota-window keys as one contract.
A mobile token is registered with a duplicate device token or an invalid environmentThe registration can fail or delivery can target the wrong mobile service.Preserve the token uniqueness rule and accept only the supported mobile environments.
A mobile token remains bound to an expired or revoked sessionPush delivery can continue after the user’s mobile authentication should no longer authorize it.Check the session hash when selecting tokens and remove registrations that no longer match the session.
A push claim key is not stable for its delivery windowOne event can send duplicate pushes or a valid push can be suppressed.Build claim IDs from the same event and time-window contract used by delivery.
Two Loom migration requests claim the same active organizationOperators or import workers can process conflicting migration state.Preserve the unique active-organization key and clear it only when the request leaves active work.
An imported Loom video is recorded without a stable video keyThe same source content can be imported more than once.Use the import ledger’s video primary key as the idempotency boundary.
A Loom request loses its lease or progress counters during an importWork can be claimed twice or the customer-facing migration status can become wrong.Update the lease, counters, operator fields, and status as one request-state contract.
A developer playback ID is reused for two videosPlayback lookup becomes ambiguous and the unique migration constraint fails.Keep playback IDs unique and assign them as part of the developer video lifecycle.
A transcript is created without its app link or with a status that does not match its credit stateThe developer service can expose data to the wrong app or hold or bill credits incorrectly.Keep the app relation, status transitions, timestamps, and reserved or billed amounts aligned.
A webhook secret is stored without encryption or a deleted endpoint remains in active delivery selectionAn app secret can be exposed or events can go to an endpoint the app removed.Use the encrypted field contract and exclude soft-deleted endpoints from delivery.
A video storage deadline or import state is updated without its matching billing or worker stateStorage charges can be missed or an import can be retried or reported with the wrong result.Update the deadline, state, source identity, byte count, and completion or error time as one media contract.
A delivery log file is processed twice or daily rows use the wrong app, day, or tier keyUsage and delivery charges can be duplicated or assigned to the wrong period.Use the log-file ledger and the app-day-tier primary key during aggregation and finalization.

Key files

FileWhy to read it
packages/…/schema.tsThe central model for identity, tenancy, content, sharing, storage, API, processing, lifecycle sync, mobile push, Loom migration, MCP OAuth, and developer data.
packages/…/index.tsThe shared MySQL client boundary and common update helper.
packages/…/migrate.tsThe runtime migration sequence and its data-repair behavior.
packages/…/drizzle.config.tsThe schema source, MySQL dialect, output path, naming rule, and table filter used by Drizzle Kit.
packages/…/0040_recording_jobs.sqlThe migration that creates durable video processing job state and its worker lookup indexes.
packages/…/0041_saml_sso.sqlThe migration that adds organization SSO billing data and a unique external organization mapping.
packages/…/0044_awesome_sugar_man.sqlThe migration that adds lifecycle synchronization jobs, the due-time index, and user marketing-origin data.
packages/…/0045_steep_forge.sqlThe migration that adds the teammate-join timestamp to lifecycle synchronization jobs.
packages/…/0046_mcp_oauth.sqlThe migration that adds MCP client, authorization-code, and token state.
packages/…/0047_mcp_client_lifecycle.sqlThe migration that adds client activation state and inactive-client lookup support.
packages/…/0048_mcp_registration_quota.sqlThe migration that adds registration-window counts and active-token lookup support.
packages/…/0049_jittery_professor_monster.sqlThe migration that adds per-video viewer grants and the organization default video-visibility field.
packages/…/0050_loom_concierge.sqlThe migration that adds Loom migration request state and the imported-video ledger.
packages/…/0051_fancy_talkback.sqlThe migration that adds query indexes for notifications, upload start times, and organization content ordering.
packages/…/0052_directory_sync.sqlThe migration that adds organization directory mappings and durable directory-sync state.
packages/…/0053_mobile_push_tokens.sqlThe migration that adds mobile device registrations and at-most-once push claims.
packages/…/0054_developer_video_playback.sqlThe migration that adds developer video playback, processing, storage, cleanup, and billing-read support.
packages/…/0055_developer_transcripts.sqlThe migration that adds app-owned transcript state, results, credit fields, and work indexes.
packages/…/0056_developer_billing_read_indexes.sqlThe migration that adds read paths for auto top-up, credit references, completed transcripts, and held transcript credits.
packages/…/0057_developer_transcript_video.sqlThe migration that links transcript requests to developer videos and orders app video transcript reads.
packages/…/0058_developer_webhook_endpoints.sqlThe migration that adds app webhook destinations, encrypted secrets, event subscriptions, and delivery-health state.
packages/…/0059_developer_video_first_month.sqlThe migration that adds the developer video storage billing deadline and due-work indexes.
packages/…/0060_developer_video_imports.sqlThe migration that adds durable developer video import state and source-key lookup paths.
packages/…/0061_developer_delivery_metering.sqlThe migration that adds daily delivery usage aggregates and processed log-file state.
packages/…/0062_dashboard_library_tools.sqlThe migration that adds custom space-video positions and archive-aware video library state and lookup support.
packages/…/_journal.jsonThe ordered record of committed schema changes through migration 0062.
packages/…/0062_snapshot.jsonThe generated schema snapshot for the latest database state, including space-video positions, video archive state, and the archive-aware library index.
packages/…/orgid_backfill.tsThe repair and validation flow for organization IDs.
packages/…/drizzle-adapter.tsThe link between authentication events and durable user, organization, session, and token data.
packages/…/auth-options.tsThe session-version check, provider setup, signup gate, and adapter wiring.
packages/…/crypto.tsThe encryption boundary for protected database values.
apps/…/instrumentation.node.tsThe deployment startup path that triggers migrations.
.github/…/validate-migration-journal.ymlThe repository guard for migration history integrity.