Skip to content

Database schema ​

The package creates several tables with a configurable prefix (default: integration). Publish and run migrations with:

bash
php artisan vendor:publish --tag=integrations-migrations
php artisan migrate

integrations ​

The main table storing integration records.

ColumnTypeDescription
idbigint (PK)Auto-incrementing ID
providerstringProvider identifier (matches config key)
namestringHuman-readable name
credentialstext (encrypted)Provider credentials, encrypted at rest
metadatajson (nullable)Non-sensitive configuration
owner_typestring (nullable)Polymorphic owner type (for multi-tenancy)
owner_idbigint (nullable)Polymorphic owner ID
is_activebooleanWhether the integration is active
health_statusstringCurrent health: healthy, degraded, failing, disabled
consecutive_failuresintRunning failure counter
last_error_attimestamp (nullable)When the last error occurred
anomaly_alerted_attimestamp (nullable)Set while the anomaly evaluator considers the failure rate elevated; the durable open/closed marker for the anomaly signal
last_synced_attimestamp (nullable)When the last sync completed with no failed items. A run with failures does not move it, so it records the last time syncing worked end to end. Staleness is measured from it.
next_sync_attimestamp (nullable)When the next sync should run. Advances on every finalised run, clean or not.
consecutive_sync_failuresintRuns that finalised with failures since the last clean one. Sets the multiplier for the next_sync_at backoff. Distinct from consecutive_failures, which counts API-boundary faults and resets on any successful request.
sync_stale_alerted_attimestamp (nullable)Set while the integration counts as stale; the durable open/closed marker for the staleness signal
sync_interval_minutesint (nullable)Override for provider's default interval
sync_cursorjson (nullable)Incremental sync cursor
timestampscreated_at, updated_at

integration_requests ​

API request/response log. One row per API call (including retries).

ColumnTypeDescription
idbigint (PK)Auto-incrementing ID
integration_idbigint (FK)Parent integration
endpointstringLogical endpoint or URL path
methodstringHTTP method or SDK operation
status_codeint (nullable)HTTP status code
request_datatext (nullable)Request body/params (redacted if applicable)
idempotency_keystring (nullable)Idempotency key for the call. See Idempotency.
provider_request_idstring (nullable)Upstream's request ID (Stripe Request-Id, GitHub X-GitHub-Request-Id, etc.).
response_datatext (nullable)Response body (redacted if applicable)
errortext (nullable)Error message on failure
failure_classstring (nullable)FailureClass on the failure path (upstream / throttle / client / unknown); null on success
duration_msint (nullable)Request duration in milliseconds
retry_ofbigint (nullable)Points to the original request if this is a retry
related_typestring (nullable)Polymorphic related model type
related_idbigint (nullable)Polymorphic related model ID
cache_hitsintNumber of cache hits for this response
stale_hitsintNumber of stale cache fallbacks
timestampscreated_at, updated_at

integration_logs ​

Operation-level logs (syncs, imports, webhooks).

ColumnTypeDescription
idbigint (PK)Auto-incrementing ID
integration_idbigint (FK)Parent integration
operationstringOperation type (sync, import, webhook, etc.)
directionstringinbound or outbound
statusstringFree-form, e.g. success, failed, processing, pending
summarystring (nullable)Human-readable summary
external_idstring (nullable)External record ID
metadatajson (nullable)Structured metadata (counts, request IDs, etc.)
result_datajson (nullable)Structured output from the operation
errortext (nullable)Error message on failure
attemptsmallint (nullable)Retry attempt when a failure was logged inside a sync item run; null otherwise
max_attemptssmallint (nullable)The configured retry ceiling at log time; null outside a sync item run
duration_msint (nullable)Operation duration
parent_idbigint (nullable)For hierarchical logging
timestampscreated_at, updated_at

integration_mappings ​

External ID to internal model mapping.

ColumnTypeDescription
idbigint (PK)Auto-incrementing ID
integration_idbigint (FK)Parent integration
external_idstring (500)External provider ID
internal_typestringInternal model class
internal_idstringInternal model ID
timestampscreated_at, updated_at

Unique constraint on (integration_id, external_id, internal_type).

integration_idempotency_keys ​

Idempotency-key ledger. One row per (integration_id, key) pair held by a keyed call (at()->withIdempotencyKey($key)->post(...)). See Idempotency.

ColumnTypeDescription
idbigint (PK)Auto-incrementing ID
integration_idbigint (FK)Parent integration
keystring(191)Application-supplied key, unique per integration
timestampscreated_at, updated_at

Unique constraint on (integration_id, key).

integration_sync_items ​

One row per item dispatched during a sync run. Tracks whether the item's listeners completed, so the cursor only advances past finished items. See Scheduled syncs.

ColumnTypeDescription
idbigint (PK)Auto-incrementing ID
integration_idbigint (FK)Parent integration
batch_idstring(36, nullable)Bus batch UUID, set after dispatch; for ops/Horizon correlation only
sync_log_idbigint (FK, nullable)Parent integration_logs row for the run
event_classstringThe per-item event class, for ops/debugging
external_idstring(500, nullable)Adapter-provided external identifier, for ops/debugging
checkpoint_valuejson (nullable)The cursor token this item represents; reduced into the next sync_cursor
statusstring(16)pending, processing, success, failed, skipped
errortext (nullable)Exception message on terminal failure
attemptssmallintAttempt count at the last status change
completed_attimestamp (nullable)When the item reached a terminal state
timestampscreated_at, updated_at

Indexed on (integration_id, status), (integration_id, created_at), (sync_log_id, status), (batch_id, status). Completed (success / skipped) rows are pruned by integrations:prune; failed rows are kept until resolved.

integration_incidents ​

Durable audit of periods an integration was in trouble. At most one open row per integration, written from health, circuit and sync-staleness state-change events; see Incident history.

ColumnTypeDescription
idbigint (PK)Auto-incrementing ID
integration_idbigint (FK)Parent integration
statusstring(16)open or closed
sourcestring(16)What opened it: health, circuit, or sync
reasonstringOpening reason (e.g. health_degraded, threshold_reached)
peak_severitystringWorst HealthStatus reached over the incident's life
opened_attimestampWhen the incident opened
last_error_attimestamp (nullable)Snapshot of the integration's last_error_at, refreshed on escalate
closed_attimestamp (nullable)When the incident closed
timestampscreated_at, updated_at

Indexed on (integration_id, status) and (integration_id, opened_at). Closed rows are pruned by integrations:prune (pruning.incidents_days, default 365); open rows are never pruned.

integration_webhooks ​

Webhook audit trail.

ColumnTypeDescription
idbigint (PK)Auto-incrementing ID
integration_idbigint (FK)Parent integration
delivery_idstringProvider delivery ID, or a fallback ID derived from the HTTP method, raw query string and body
event_typestring (nullable)Resolved event type
methodstring(16)Real HTTP method before any method override. Not null; defaults to POST
querylongtext (nullable)Raw query string exactly as received. Null when empty
payloadlongtextFull raw webhook body. Its byte length plus the raw query string's byte length must not exceed webhook.max_payload_bytes at ingestion
headersjsonRequest headers
statusstringpending, processing, processed, failed
attemptsunsigned smallintNumber of times a job has claimed this webhook. A failed webhook is not retried once this reaches webhook.max_attempts
errortext (nullable)Error message from the last attempt. Null unless status is failed
processed_attimestamp (nullable)When the webhook was marked processed or failed
timestampscreated_at, updated_at

Unique constraint on (integration_id, delivery_id). Indexed on (integration_id, created_at), and on (status, updated_at) for the queries in integrations:recover-webhooks.

payload and query use Laravel's longText type: LONGTEXT on MySQL and MariaDB (up to 4,294,967,295 bytes per column), and text on PostgreSQL and SQLite. PostgreSQL and SQLite do not have MySQL's 65,535-byte TEXT cap. The configured webhook.max_payload_bytes limits the combined byte length of the raw body and raw query string that the controller accepts, including GET deliveries.