Skip to content

Migration

Viames Marino edited this page Oct 19, 2026 · 2 revisions

Pair framework: Migration

Pair\Models\Migration tracks executed migrations.

Main methods

  • executionTime(): string

Lifecycle/config:

  • _init() defines migration record schema

Implementation example

use Pair\Models\Migration;

$migration = Migration::firstWhere('file', '202602230900_create_orders.sql');

if ($migration) {
    echo $migration->executionTime();
}

Notes

  • Useful for migration dashboards and execution diagnostics.
  • The migration filename is stored in file; source distinguishes application and framework migrations through SOURCE_APP and SOURCE_PAIR. A file may have multiple rows, one per executed query; include source and query_index filters when identifying a specific execution.

See also: Database, Query.

Clone this wiki locally