Closed bldrvnlw closed 1 year ago
@bldrvnlw Thanks for reporting.
Could you please check your doctrine/dbal
version?
I too have the same issue if I install doctrine/dbal
v3, if this is the case, you should use doctrine/dbal
v2 given you are using a really old version of Laravel. See https://github.com/laravel/framework/blob/5.8/composer.json#L121
Here are my steps to generate migration files successfully.
php74 /opt/homebrew/bin/composer create-project --prefer-dist laravel/laravel blog "5.8.*"
php74 /opt/homebrew/bin/composer require doctrine/dbal:^2.0
php74 /opt/homebrew/bin/composer require --dev "kitloong/laravel-migrations-generator"
php74 artisan migrate:generate
Thanks for the answer! Indeed it's an old version we're in the process of upgrading to a newer Laravel - the generation of the migrations is part of the whole cleanup.
The dbal version on this system is 2.13.9. I'm still getting that error - perhaps another package is the cause. I could post the composer.lock file if that helps
@bldrvnlw Please post your composer.json
to reproduce the issue.
Here it is:
{
"name": "laravel/laravel",
"config": {
"preferred-install": "dist",
"platform": {
"php": "7.3"
}
},
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4 <7.4",
"laravel/framework": "5.8.*",
"laravelcollective/html": "5.8.*",
"guzzlehttp/guzzle": "^6.2",
"predis/predis": "^1.1",
"rairlie/laravel-locking-session": "^1.1",
"laracasts/utilities": "^3.2",
"laravel/tinker": "^1.0",
"doctrine/dbal": "2.*"
},
"require-dev": {
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "7.*",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*",
"fakerphp/faker": "^1.19",
"kitloong/laravel-migrations-generator": "^6.4"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"fuma\\": "app/"
},
"files": [
"app/Helper/helpers.php"
]
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
}
}
Hi @bldrvnlw , thank you for the details.
I have replaced it with your composer.json
, I am able to generate migrations successfully.
I amended the following to make it work in my local:
"psr-4": {
"App\\": "app/"
},
Remove
"files": [
"app/Helper/helpers.php"
]
You may have other conflicts in your source code lead to this error. I am closing this issue now since this is not the migration generator error.
Thanks for your help!
Describe the bug The following error appears and no migrations are created:
To Reproduce Steps to reproduce the behavior: Install the package on a laravel 5.8 installation with sqlite as database.
php artisan migrate:generate celltype
Expected behavior A create migration file would be produced
Screenshots None
Details (please complete the following information):
Additional context NA