Coder Social home page Coder Social logo

levizoesch / laravel-check-migrations Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4 KB

A Laravel command scans your application for pending migrations, providing a clear overview of what needs to be migrated. You can then choose to run individual migrations or skip them as needed, short-cutting and optimizing your development workflow.

PHP 100.00%

laravel-check-migrations's Introduction

Check Migrations

A Laravel command scans your application for pending migrations, providing a clear overview of what needs to be migrated. You can then choose to run individual migrations or skip them as needed, short-cutting and optimizing your development workflow.

Support for Structured Migrations

This package seamlessly handles migrations organized within subdirectories, ensuring that no pending migrations are overlooked regardless of the project's migration structure.

database
└── migrations
├── 2023_01_01
│ ├── 20230101000001_create_table_one.php
│ └── 20230101000002_create_table_two.php
└── 2023_02_01
├── 20230201000001_create_table_three.php
└── 20230201000002_create_table_four.php

Installation

composer require levizoesch/laravel-check-migrations

Usage

Run the following command in your terminal:

This will display pending migrations and prompt for confirmation before running each one.

php artisan check-migrations

This will skip confirmation and run pending migrations directly.

php artisan check-migrations --skip

This will ignore the migration named 20230101000000_create_example_table from running and prompting for confirmation.

php artisan check-migrations --ignore=20230101000000_create_example_table

Notes

Ensure that your Laravel project is properly configured and migrations are set up correctly for this command to work effectively.

Always review pending migrations before running them in production environments to prevent unintended consequences.

Known Issues

Double Confirmation Prompts in Production

When running the check-migrations command in a production environment, users may encounter double confirmation prompts. This occurs due to Laravel's native migrate command prompting for confirmation before migrating when in production mode. Since the check-migrations command internally calls the migrate command for each pending migration, users may be prompted twice for confirmation for each migration.

laravel-check-migrations's People

Contributors

levizoesch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.