GithubHelp home page GithubHelp logo

migrator's Introduction

Migrator

Migrator is a GUI migration manager for Laravel which you can create, manage and delete your migration.

Also, with Migrator you will be able to use a feature called "Safe Migrate" which allows you to run migration without fear of foreign key sorting, it will automatically run migrations in the correct order and you don't need to change the migrations filename.

Migrator photo

Installation:

To install Migrator you can execute this command:

composer require rezaamini-ir/migrator

Then you will access to /migrator route.

Config

To access config file you need to publish config files to your project with this command:

php artisan vendor:publish --tag=migrator-config

Now you will be able to change config as you want!

To change the route path you can change the route key in migrator config.

And, with middleware key you can set your middleware to authenticate your user.

If you don't need to authenticate users to access migrator you can set the value to web.

migrator's People

Contributors

abbasudo avatar adjarriawan avatar afsh7n avatar ash-jc-allen avatar dsbilling avatar hosseinkalateh avatar imanghafoori1 avatar laravel-shift avatar mohsennazari avatar reziamini avatar shealavington 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  avatar

migrator's Issues

Style of paginator

Hi,
I'm on chrome v97.0.4692.71 and I'm using Laravel v8.79.0, Livewire 2.9.0 and migrator v1.5.2.
As you can see in the attached image, the paginator pages and arrows seem to be "unstyled": is this correct or my issue?
If first, are you planning a new minor release to style them?
error_on_paginators_page

Undefined array

Issue trying to install for the first time.
Composer worked without a hitch.
Visiting the /migrator route seemed to fail instantly with the following.

Error:

ErrorException
Undefined array key 1 (View: [redacted]\vendor\rezaaminiir\migrator\resources\views\livewire\migration\read.blade.php)

Code on line:
https://github.com/rezaamini-ir/migrator/blob/d30d29602cf7bb4f0e642118c800dbd33d3ba093/src/Service/StructureParser.php#L85

PHP: v8
Laravel: "laravel/framework": "^8.0",
A related issue: #7
Line Issue Reference:

Wrong Connection Showing

Awesome fix on the last issue, but a new one presents:
A wrong connection is displayed.

Connection ONE instead of connection TWO is displayed as the connection used, it also shows too much data.

Migration:

        if (Schema::connection('one')->hasColumn('my_table', 'table_column')) {
            Schema::connection('two')->create('table_in_two', function (Blueprint $table) {
                $table->bigIncrements('id');
            });
        }

Outputs:
one')->hasColumn('my_table', 'table_column

Expected:
two

There appears to be two issues.

  1. Regex is too greedy, needs to stop at the next single quote (') found, not the last
  2. Needs to find the connection used not just the first one there (harder)

Unable to install

Greetings,

This looks like a very useful package. Unfortunately after I install it and navigate to the "migrator" URL I get the following error:

ErrorException Undefined offset: 1 (View: C:\laragon\www\test_project\vendor\rezaamini-ir\migrator\resources\views\livewire\migration\read.blade.php)

Is there a compatibility issue with L8?

Thanks!

requirements is missing

Would appreciate a blurb about what laravel versions have been tested. Like: Would it work with Laravel 8?

fis this issue

Problem 1
- rezaamini-ir/migrator[1.0.0, ..., 1.5.3] require illuminate/support ^6.0|^7.0|^8.0 -> found illuminate/support[v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27] but these were not loaded, likely because it conflicts with another require.
- rezaamini-ir/migrator[1.5.4, ..., 1.5.5] require illuminate/support ^6.0|^7.0|^8.0|^9.0 -> found illuminate/support[v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require.
- rezaamini-ir/migrator[1.5.6, ..., 1.5.8] require livewire/livewire ^1.0|^2.5 -> found livewire/livewire[v1.0.0, ..., v1.3.9, v2.5.0, ..., v2.12.6] but it conflicts with your root composer.json require (^3.0).
- Root composer.json requires rezaamini-ir/migrator * -> satisfiable by rezaamini-ir/migrator[1.0.0, ..., 1.5.8].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require rezaamini-ir/migrator:*" to figure out if any version is installable, or "composer require rezaamini-ir/migrator:^2.1" if you know which you need.

Arrow function but Composer allows PHP 7.3

Hey! When I was just making a PR, I noticed that in src/Service/StructureParser.php on line 32, the line is:

return array_filter($this->structure, fn($value) => !is_null($value['type']));

This line uses an arrow function and (as far as I'm aware) these can only be used on PHP 7.4 upwards. However, the composer.json file looks like it allows PHP 7.3.

I'm guessing the composer.json just needs changing to make PHP 7.4 the minimum? Or just switching the arrow function back to a closure if you want to keep support for 7.3? I'm happy to make a PR for either if needed :)

Add SeederManeger Features

hi
I think as much as we have a problem with migrations, we also have a problem with seeders. Of course, maybe more because it does not support Laravel well in the modular program and we have to enter its class manually in the console.

Class name must be a valid object or a string

  • PHP 8.2.4
  • Laravel 10
  • Release 1.5.7
[2023-04-20 13:58:11] local.ERROR: Class name must be a valid object or a string {"view":{"view":"/var/www/vs-workspace/pa/vendor/rezaamini-ir/migrator/resources/views/livewire/migration/read.blade.php","data":[]},"userId":119,"exception":"[object] (Spatie\\LaravelIgnition\\Exceptions\\ViewException(code: 0): Class name must be a valid object or a string at /var/www/vs-workspace/pa/vendor/rezaamini-ir/migrator/src/Service/MigratorParser.php:124)
[stacktrace]

#0 /var/www/vs-workspace/pa/vendor/rezaamini-ir/migrator/src/Http/Livewire/Migration/Single.php(75): Migrator\\Service\\MigratorParser->getPreview()

#1 /var/www/vs-workspace/pa/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Migrator\\Http\\Livewire\\Migration\\Single->mount()

I think it's due to the changes for the last release for the query preview functionality.

Can not publish config file

OS: Xubuntu 20.04
Laravel 8
package version: 1.5

I successfully installed the package but when publishing the I get the following error:

No publishable resources for tag [migrator-config].

when APP_ENV is production , undefined STDIN error

if APP_ENV is production ,
when use \Artisan::call , can have error about undefined STDIN.

so, when I modify 'vendor/rezaamini-ir/migrator/src/Http/Livewire/Migration/Single.php' file,

add option '--force' => true to every function (migrate, refresh, rollback) can solve this problem

for example,

/**

  • Run migration command.
    */
    public function migrate()
    {
    try {
    \Artisan::call('migrate', [
    '--path' => $this->getPath(),
    '--force' => true
    ]);

I hope apply this solution.

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.