Giter Site home page Giter Site logo

laravel-migrations-organiser's Introduction

Laravel Migrations Organiser

Total Downloads

The number of migrations in any sized project can quickly become huge, and although they are ordered, having one big list can sometimes be inconvenient and slow to navigate.

This package will put your migrations in yyyy/mm folders e.g.

./database/migrations/2015/03/2015_03_25_210946_create_users_table.php

Versions

  • Laravel 5.3-6.* use v4.*
  • Laravel 7.* use v5.*
  • Laravel 8 & 9 use v6.*

Installation

composer require jaybizzle/laravel-migrations-organiser

Add the following to the providers array in your config/app.php file..

    Jaybizzle\MigrationsOrganiser\MigrationsOrganiserServiceProvider::class,

Laravel ^5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider

Usage

This package hooks into the default artisan make:migration command. Just use that as you normally would and the package takes care of the rest.

What if I have already created migrations

No problem, just run artisan migrate:organise and your migrations will be moved into the relevant yyyy/mm folders.

I want my migrations back to how they were

Again, no problem. Running artisan migrate:disorganise will move all migrations from the yyyy/mm folder structure into the base migrations folder. Add the --force option to delete left over folders without confirmation.

Analytics

laravel-migrations-organiser's People

Contributors

brandonferens avatar dmitryuk avatar jaybizzle avatar jorisdebonnet avatar jwcastillo avatar laravel-shift avatar maxgiting avatar peter279k avatar scrutinizer-auto-fixer avatar skyrpex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

laravel-migrations-organiser's Issues

Laravel 7 Support

Can you please make a new release that includes Laravel 7 support? I see it's updated on master.

Laravel 5.6

Can't be installed with fresh Laravel 5.6

  • Installation request for jaybizzle/laravel-migrations-organiser ^4.1 -> satisfiable by jaybizzle/laravel-migrations-organiser[v4.1.0, v4.1.1].
    • Conclusion: don't install laravel/framework v5.6.0
      jaybizzle/laravel-migrations-organiser v4.1.0 requires illuminate/support 5.3.|5.4.|5.5.* -> satisfiable by laravel/framework[5.3.x-dev, 5.4.x-dev, 5.5.x-dev], illuminate/support[5.3.x-dev, 5.4.x-dev, 5.5.x-dev, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35].
      I have made pull request
      #24

Laravel 5.5 artisan migrate:(dis)organise failure

Greetings,

Thank you for bringing this to Laravel 5.5.
There appears to be an issue with the commands migrate:organise, migrate:disorganise.

Error:

[ReflectionException]
Method Jaybizzle\MigrationsOrganiser\Commands\MigrateOrganise::handle() does not exist

Instead of handle(), a method fire() exists. In the documentation for 5.0, it does indeed say the correct method is fire(), but it seems from 5.1 on, this has changed.

Link to source on the change from 5.1 - https://mattstauffer.com/blog/creating-artisan-commands-with-the-new-simpler-syntax-in-laravel-5.1/

Everything else seems to work perfectly, thank you.

Sincerely,
Alarich

Laravel 8 Support

Can Laravel 8 support be provided? This package blocks upgrading apps to the new version.

Custom stub files

It seems like its not taking into account our custom stub file for migration.creation etc. It just seems to ignore them.

Thank You

This isn't an issue, but I just wanted to say thank you for this package. It's brilliant! :)

php artisan --path not being able to run only one file

UnexpectedValueException : RecursiveDirectoryIterator::__construct(/var/www/html/database/migrations/2020/11/2020_11_27_053044_test.php): failed to open dir: Not a directory

at /var/www/html/vendor/jaybizzle/laravel-migrations-organiser/src/Migrator.php:47
43| $paths = [];
44|
45| foreach ($folders as $folder) {
46| $iter = new Iterator(

47| new DirectoryIterator($folder, DirectoryIterator::SKIP_DOTS),
48| Iterator::SELF_FIRST,
49| Iterator::CATCH_GET_CHILD // Ignore "Permission denied"
50| );
51|

Exception trace:

1 RecursiveDirectoryIterator::__construct("/var/www/html/database/migrations/2020/11/2020_11_27_053044_test.php")
/var/www/html/vendor/jaybizzle/laravel-migrations-organiser/src/Migrator.php:47

2 Jaybizzle\MigrationsOrganiser\Migrator::getRecursiveFolders()
/var/www/html/vendor/jaybizzle/laravel-migrations-organiser/src/Migrator.php:22

Please use the argument -v to see more details.

Fix tests

Core code works, but tests need updating to work with Illuminate 5.1

Carbon 2

Would it be possible to update the Carbon dependency to use version 2?

Laravel 5.7.3 Cannot install laralve-migrations-organiser

Long story short
Tried updating from laravel 5.6.* to laravel 5.7
Even tried via require, and adding it manually to composer.json
Always the same message:

`Your requirements could not be resolved to an installable set of packages.

Problem 1
- Conclusion: don't install jaybizzle/laravel-migrations-organiser v4.1.2
- Conclusion: don't install jaybizzle/laravel-migrations-organiser v4.1.1
- Conclusion: don't install jaybizzle/laravel-migrations-organiser v4.1.0
- Conclusion: don't install jaybizzle/laravel-migrations-organiser v4.0.3
- Conclusion: don't install jaybizzle/laravel-migrations-organiser v4.0.2
- Conclusion: don't install jaybizzle/laravel-migrations-organiser v4.0.1
- Conclusion: remove laravel/framework v5.7.3
- Installation request for jaybizzle/laravel-migrations-organiser 4.* -> satisfiable by jaybizzle/laravel-migrations-organiser[v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.1.0, v4.1.1, v4.1.2].
- Conclusion: don't install laravel/framework v5.7.3
- jaybizzle/laravel-migrations-organiser v4.0.0 requires illuminate/support 5.3.* -> satisfiable by laravel/framework[5.3.x-dev], illuminate/support[5.3.x-dev, v5.3.0, v5.3.16, v5.3.23, v5.3.4].
- illuminate/support 5.3.x-dev conflicts with laravel/framework[v5.7.3].
- illuminate/support v5.3.0 conflicts with laravel/framework[v5.7.3].
- illuminate/support v5.3.16 conflicts with laravel/framework[v5.7.3].
- illuminate/support v5.3.23 conflicts with laravel/framework[v5.7.3].
- illuminate/support v5.3.4 conflicts with laravel/framework[v5.7.3].
- laravel/framework 5.3.x-dev conflicts with laravel/framework[v5.7.3].
- Installation request for laravel/framework (locked at v5.7.3, required as 5.7.*) -> satisfiable by laravel/framework[v5.7.3].

Installation failed, reverting ./composer.json to its original content.`

Lumen support?

I have a Lumen project where I would like to use this package. I will admit I'm fairly new to Laravel. I can install and run this package just fine in a Laravel project but, in Lumen it gives me the following error when I just list the artisan commands:

"[ErrorException]
  Argument 2 passed to Jaybizzle\MigrationsOrganiser\Commands\MigrateOrganise::__construct() must be an instance of Jaybizzle\MigrationsOrganiser\Migrator, instance of Illuminate\Database\Migrations\Migrator given, called in /var/www/
  migrationTest/vendor/jaybizzle/laravel-migrations-organiser/src/MigrationsOrganiserServiceProvider.php on line 38 and defined"

It gives a similar error for the MigrateDisorganise command too. Would if be fairly easy to get this working for Lumen as well?

Thanks.

Laravel 10 support

I just upgraded to Laravel 10. Had to disable this package for now. Just FYI when trying to add it back in I get the following errors:

  Problem 1
    - jaybizzle/laravel-migrations-organiser v1.0.0 requires illuminate/support ~4.2 -> found illuminate/support[v4.2.1, ..., v4.2.17] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser v2.0.0 requires illuminate/support ~5.0 -> found illuminate/support[v5.0.0, ..., v5.8.36] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser v2.0.1 requires illuminate/support 5.0.* -> found illuminate/support[v5.0.0, ..., v5.0.33] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser v3.0.0 requires illuminate/support 5.* -> found illuminate/support[v5.0.0, ..., v5.8.36] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser v3.0.1 requires illuminate/support 5.1.*|5.2.* -> found illuminate/support[v5.1.1, ..., v5.2.45] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser[v4.0.0, ..., v4.0.2] require illuminate/support 5.3.* -> found illuminate/support[v5.3.0, v5.3.4, v5.3.16, v5.3.23] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser v4.0.3 requires illuminate/support 5.3.*|5.4.* -> found illuminate/support[v5.3.0, ..., v5.4.36] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser[v4.1.0, ..., v4.1.1] require illuminate/support 5.3.*|5.4.*|5.5.* -> found illuminate/support[v5.3.0, ..., v5.5.44] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser v4.1.2 requires illuminate/support 5.3.*|5.4.*|5.5.*|5.6.* -> found illuminate/support[v5.3.0, ..., v5.6.39] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser v4.1.3 requires illuminate/support 5.3.*|5.4.*|5.5.*|5.6.*|5.7.* -> found illuminate/support[v5.3.0, ..., v5.7.28] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser v4.1.4 requires illuminate/support 5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.* -> found illuminate/support[v5.3.0, ..., v5.8.36] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser v4.3.0 requires illuminate/support ^5.3|^6.0|^7.0 -> found illuminate/support[v5.3.0, ..., v5.8.36, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser[v4.2.0, ..., v4.4.0, v5.0.0] require illuminate/support ^5.3|^6.0 -> found illuminate/support[v5.3.0, ..., v5.8.36, v6.0.0, ..., v6.20.44] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser v5.0.1 requires illuminate/support ^7.0 -> found illuminate/support[v7.0.0, ..., v7.30.6] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser v5.0.2 requires php ^7.2.5 -> your php version (8.2.0; overridden via config.platform, same as actual) does not satisfy that requirement.
    - jaybizzle/laravel-migrations-organiser v6.0.0 requires php ^7.3 -> your php version (8.2.0; overridden via config.platform, same as actual) does not satisfy that requirement.
    - jaybizzle/laravel-migrations-organiser v6.1.0 requires php >=7.3 <8.1 -> your php version (8.2.0; overridden via config.platform, same as actual) does not satisfy that requirement.
    - jaybizzle/laravel-migrations-organiser v6.1.1 requires illuminate/support ^8.0 -> found illuminate/support[v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
    - jaybizzle/laravel-migrations-organiser v6.2.0 requires illuminate/support ^8.0|^9.0 -> found illuminate/support[v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.0] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires jaybizzle/laravel-migrations-organiser * -> satisfiable by jaybizzle/laravel-migrations-organiser[v1.0.0, v2.0.0, v2.0.1, v3.0.0, v3.0.1, v4.0.0, ..., v4.4.0, v5.0.0, v5.0.1, v5.0.2, v6.0.0, v6.1.0, v6.1.1, v6.2.0].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require jaybizzle/laravel-migrations-organiser:*" to figure out if any version is installable, or "composer require jaybizzle/laravel-migrations-organiser:^2.1" if you know which you need.

Hopefully that helps with preparing a Laravel 10 compatible version. Thanks!!!

Support php 8.1

I noticed composer.json requires php <8.1. Is there an incompatibility with php 8.1 then? If not, can't we just use >=8.0?

Doesn't ask me to confirm folder deletion

Is this working for you? It just deletes the folders without asking the question

This is all the output i get...

php artisan migrate:disorganise
Migrations disorganised successfully

Run clean up function?
This will delete all subdirectories in the migrations directory

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.