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
last_synced_attimestamp (nullable)When the last sync completed
next_sync_attimestamp (nullable)When the next sync should run
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
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
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_webhooks

Webhook audit trail.

ColumnTypeDescription
idbigint (PK)Auto-incrementing ID
integration_idbigint (FK, nullable)Parent integration (null for generic webhooks)
providerstringProvider identifier
event_typestring (nullable)Resolved event type
delivery_idstring (nullable)Deduplication key
payloadtextFull webhook payload
headersjson (nullable)Request headers
statusstringpending, processing, processed, failed
processed_attimestamp (nullable)When processing completed
timestampscreated_at, updated_at