title: Database & Migrations description: Tables created by Guardrails and important columns.
Database & Migrations
Publish the migrations and run them:
php artisan vendor:publish --provider="OVAC\\Guardrails\\GuardrailsServiceProvider" --tag=guardrails-migrations
php artisan migrate
Tables
guardrail_approval_requests
id— Primary keyapprovable_type,approvable_id— Morph target of the changeinitiator_id— User who initiated the change (from your configured guard)state— pending|approved|rejected (package now uses all three)description— Short human summary of the captured changenew_data— JSON snapshot of proposed valuesoriginal_data— JSON snapshot of original valuescontext— JSON route/event metadatameta— JSON for future extensionscreated_at,updated_at
guardrail_approval_steps
id,request_id— Belongs to an approval requestlevel— Step order (1-based)name— Display name of the stepthreshold— Minimum approvals required for this stepstatus— pending|completed|rejectedcompleted_at— Timestamp when threshold metmeta— JSON includingsigners,include_initiator,preapprove_initiator,rejection_min,rejection_maxcreated_at,updated_at
guardrail_approval_signatures
id,step_id— Belongs to a stepsigner_id— Signer user iddecision— approved|rejected|postponed (package usesapprovedandrejected)comment— Optional signer comment captured for approvals and rejectionssigned_at— Timestamp of the decisionmeta— JSON for extensionscreated_at,updated_at
Relationships
ApprovalRequesthasManyApprovalStepApprovalStephasManyApprovalSignatureApprovalSignaturebelongsToApprovalStepApprovalRequestmorphToapprovable