halpdesk/laravel-migration-commands

There is no license information available for the latest version (0.9.2) of this package.

Better commands for migrations when developing a Laravel project

0.9.2 2019-09-04 09:59 UTC

This package is auto-updated.

Last update: 2024-05-04 20:35:45 UTC


README

This package provides commands for migrating files in a Laravel project, which are useful at developing time.

By halpdesk, 2019-07-22

Installation

Open config/app.php and insert the following into the Package Service Providers list:

Halpdesk\LaravelMigrationCommands\LaravelServiceProvider::class,

Then run composer dump-autoload

List of Commmands

Migrate all tables

migrate:all

Rolls back all migration files and migrates them again

To seed the database after migration is finished, use the --seed option.

Migrate specific file

migrate:specific --file= <file>

Migrate one specific file. Does not take regard to order of migration files. The --file parameter is required and takes a full (absolute) path.

To instead rollback the migration, use the the --rollback option.

Drop all tables

migrate:dropall

Disables all foreign key constraints and drops all tables. This is useful when when a migration file is renamed or the order is changed during development. The user is not prompted with a choice to continue before proceeding as well as a count down which can be cancelled with CTRL+C.

To escape the prompt and countdown, add the --force option.

Re-seed database

db:reseed

Disables all foreign key constriants, truncates all tables and seeds all tables

To use another class instead of DatabaseSeeder, use the class option