Giter Club home page Giter Club logo

Comments (6)

kitloong avatar kitloong commented on June 13, 2024

Hi @CaraesNaur , thank you for your details.

I repeat your steps in a new Laravel project, and here is my generated migration:

        Schema::create('file_visuals', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('organization_id')->index('IDX_file_visuals_organization_id');
            $table->unsignedBigInteger('parent_company_id')->index('IDX_file_visuals_parent_company_id');
            $table->unsignedBigInteger('brand_owner_id')->index('IDX_file_visuals_brand_owner_id');
            $table->unsignedBigInteger('brand_id')->index('IDX_file_visuals_brand_id');
            $table->unsignedBigInteger('subbrand_id')->nullable()->index('IDX_file_visuals_subbrand_id');
            $table->unsignedBigInteger('created_by')->index('IDX_file_visuals_created_by');
            $table->unsignedBigInteger('owned_by')->nullable()->index('IDX_file_visuals_owned_by');
            $table->unsignedBigInteger('updated_by')->nullable()->index('IDX_file_visuals_updated_by');
            $table->unsignedBigInteger('deleted_by')->nullable()->index('IDX_file_visuals_deleted_by');
            $table->unsignedBigInteger('file_id')->index('IDX_file_visuals_file_id');
            $table->unsignedBigInteger('custom_orientation_id')->nullable()->index('IDX_file_visuals_custom_orientation_id');
            $table->unsignedSmallInteger('frame_number')->default(1);
            $table->unsignedSmallInteger('frames_count')->default(1);
            $table->unsignedSmallInteger('total_planes')->default(1);
            $table->dateTime('created_at');
            $table->dateTime('updated_at')->nullable();
            $table->dateTime('deleted_at')->nullable();
            $table->decimal('dimension_x', 12, 6)->default(0);
            $table->decimal('dimension_y', 12, 6)->default(0);
            $table->unsignedDecimal('play_duration', 8, 3)->nullable()->default(0);
            $table->decimal('plunge_angle', 12, 6)->default(0);
        });

Could you check your composer.json there is a different migration generator installed?

If you don't mind you could post your composer.json here for checking purposes.

from laravel-migrations-generator.

CaraesNaur avatar CaraesNaur commented on June 13, 2024

The only other generator present is krlove/eloquent-model-generator. I use both via scripts, as I have ~200 models/tables to deal with.

$ grep -Pi '(migrat|generat)' composer.*
composer.json:        "kitloong/laravel-migrations-generator": "^6.6",
composer.json:        "krlove/eloquent-model-generator": "^2.0@dev",
composer.json:            "@php artisan key:generate --ansi"
composer.lock:        "This file is @generated automatically"
composer.lock:                "ext-bcmath": "Needed for generation of some types of barcodes",
composer.lock:            "description": "PHP library generating PDF files from UTF-8 encoded HTML",
composer.lock:            "description": "🛠  Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.",
composer.lock:            "description": "Generate a new Laravel database seed file based on data from the existing database table.",
composer.lock:                "generators",
composer.lock:                "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
composer.lock:                "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.",
composer.lock:            "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).",
composer.lock:            "description": "Provides an object-oriented API to generate and represent UIDs",
composer.lock:                "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.",
composer.lock:                "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.",
composer.lock:            "description": "Faker is a PHP library that generates fake data for you.",
composer.lock:            "name": "kitloong/laravel-migrations-generator",
composer.lock:                "url": "https://github.com/kitloong/laravel-migrations-generator.git",
composer.lock:                "url": "https://api.github.com/repos/kitloong/laravel-migrations-generator/zipball/116f50fab918b7f1363a40ebd954ce250f6aedcd",
composer.lock:                        "KitLoong\\MigrationsGenerator\\MigrationsGeneratorServiceProvider"
composer.lock:                    "KitLoong\\MigrationsGenerator\\": "src"
composer.lock:            "description": "Generates Laravel Migrations from an existing database",
composer.lock:                "generator",
composer.lock:                "migration",
composer.lock:                "migrations"
composer.lock:                "issues": "https://github.com/kitloong/laravel-migrations-generator/issues",
composer.lock:                "source": "https://github.com/kitloong/laravel-migrations-generator/tree/v6.10.0"
composer.lock:            "name": "krlove/code-generator",
composer.lock:                "url": "https://github.com/krlove/code-generator.git",
composer.lock:                "url": "https://api.github.com/repos/krlove/code-generator/zipball/1ac521f5ef79a376282e3315ba6a13a83c63fb9a",
composer.lock:                    "Krlove\\CodeGenerator\\": "src/"
composer.lock:            "description": "Code Generator",
composer.lock:                "issues": "https://github.com/krlove/code-generator/issues",
composer.lock:                "source": "https://github.com/krlove/code-generator/tree/1.0.1"
composer.lock:            "name": "krlove/eloquent-model-generator",
composer.lock:                "url": "https://github.com/krlove/eloquent-model-generator.git",
composer.lock:                "url": "https://api.github.com/repos/krlove/eloquent-model-generator/zipball/f4383da4a6b0dd643986330e86fd39d631e569be",
composer.lock:                "krlove/code-generator": "^1.0",
composer.lock:                        "Krlove\\EloquentModelGenerator\\Provider\\GeneratorServiceProvider"
composer.lock:                    "Krlove\\EloquentModelGenerator\\": "src/"
composer.lock:            "description": "Eloquent Model Generator",
composer.lock:                "issues": "https://github.com/krlove/eloquent-model-generator/issues",
composer.lock:                "source": "https://github.com/krlove/eloquent-model-generator/tree/2.0.1"
composer.lock:                "ext-soap": "To be able to generate mocks based on WSDL files",
composer.lock:        "krlove/eloquent-model-generator": 20

Full composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^7.3|^8.0",
        "barryvdh/laravel-debugbar": "*",
        "doctrine/dbal": "^3.6",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^9.0",
        "laravel/sanctum": "^2.11",
        "laravel/telescope": "^4.15",
        "laravel/tinker": "^2.5",
        "laravel/ui": "*",
        "michaelachrisco/readonly": "^0.50.0",
        "orangehill/iseed": "^3.0",
        "stancl/tenancy": "^3.7",
        "venturedrake/laravel-crm": "^0.18.1",
        "wildside/userstamps": "^2.3"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "kitloong/laravel-migrations-generator": "^6.6",
        "krlove/eloquent-model-generator": "^2.0@dev",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^6.1",
        "phpunit/phpunit": "^9.5.10",
        "spatie/laravel-ignition": "^1.0"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        },
        "files": [
            "app/Helpers/EmbedAssets.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

from laravel-migrations-generator.

kitloong avatar kitloong commented on June 13, 2024

Hi @CaraesNaur , thank you.

I can confirm the error is caused by a conflict with krlove/eloquent-model-generator DB types registration.
The quick fix for now is to temporarily remove the library, generate migrations, and re-install the library.

Meanwhile, I will look for a way to fix this problem.

from laravel-migrations-generator.

CaraesNaur avatar CaraesNaur commented on June 13, 2024

The correct migrations were made with krlove/eloquent-model-generator 1.3.8.

This is happening with 2.0.1.

from laravel-migrations-generator.

CaraesNaur avatar CaraesNaur commented on June 13, 2024

I rolled back krlove/eloquent-model-generator to 1.3.8, the migrations are back to what they should be.

from laravel-migrations-generator.

kitloong avatar kitloong commented on June 13, 2024

This is a known issue in krlove/eloquent-model-generator#103, the types are overwritten even though the command is not executed.

Closing this as it is not related to the migrations generator.

from laravel-migrations-generator.

Related Issues (20)

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.