PHPackages                             northbees/data-migrations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. northbees/data-migrations

ActiveLibrary[Database &amp; ORM](/categories/database)

northbees/data-migrations
=========================

Queue-based data migrations for Laravel with priority scheduling and type-safety.

v1.0.0(1mo ago)11MITPHPPHP ^8.3

Since Apr 22Pushed 1mo agoCompare

[ Source](https://github.com/NorthBees/data-migrations)[ Packagist](https://packagist.org/packages/northbees/data-migrations)[ RSS](/packages/northbees-data-migrations/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

Data Migrations for Laravel
===========================

[](#data-migrations-for-laravel)

A queue-based data migration system for Laravel that separates structural database changes from data-heavy operations. Dispatch long-running data transformations as queued jobs with priority scheduling, type-safety, and production safeguards.

Why?
----

[](#why)

Standard Laravel migrations run synchronously during deployment. If you need to update 10 million rows, your deployment script will time out. This package dispatches data migrations as queued jobs so your deployment finishes immediately while data churns safely in the background.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 12 or 13

Installation
------------

[](#installation)

```
composer require NorthBees/data-migrations
```

The service provider is auto-discovered. Publish the config and run migrations:

```
php artisan vendor:publish --tag=data-migrations-config
php artisan migrate
```

The package automatically loads its own migrations, so `php artisan migrate` is all you need. If you'd prefer to have the migration files in your application (e.g. to customise the schema), you can publish them:

```
php artisan vendor:publish --tag=data-migrations-migrations
```

This copies the migration files into your application's `database/migrations/` directory. Once published, the package will no longer auto-load its copies — your published versions take precedence.

Configuration
-------------

[](#configuration)

```
// config/data-migrations.php

return [
    'table'        => 'data_migrations',
    'failed_table' => 'failed_data_migrations',
    'path'         => database_path('data-migrations'),

    // Low-priority jobs are delayed until this window
    'off_peak_start' => '00:00',
    'off_peak_end'   => '06:00',

    // Queue names
    'queue_high' => 'default',
    'queue_low'  => 'data-migrations-low',

    // Safety
    'prevent_deletes_in_production' => false,
];
```

Usage
-----

[](#usage)

### Creating a data migration

[](#creating-a-data-migration)

```
php artisan make:data-migration fix_users_email --priority=high --type=alter
```

This generates a timestamped file in `database/data-migrations/`:

```
