Closed msbsh closed 4 years ago
Hello, thank you for report.
Unfortunately I can't reproduce your issue from my end.
The error is due to type enum
is registered 2 times, while in the package enum
should only register one time which is when command is triggered.
Do you mind to show me your composer.json
to see if there is any conflict on this?
Probably 2 migration packages with same command php artisan migrate:generate
or something
Sure thing and thanks for your support. I'm actually fairly new to composer/laravel/artisan in general, so I really much appreciate your support on this.
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0",
"tcg/voyager": "^1.3"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"kitloong/laravel-migrations-generator": "^4.0",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"repositories": {
"hooks": {
"type": "composer",
"url": "https://larapack.io"
}
}
}
Thank you for sharing.
The generator has conflict with
Larapack\DoctrineSupport\DoctrineSupportServiceProvider
protected function addDoctrineTypes(Connection $connection)
{
$name = $connection->getDriverName();
foreach (Arr::get($this->types, $name, []) as $type => $handler) {
if (!Type::hasType($type)) {
Type::addType($type, $handler);
}
$connection->getDoctrineConnection()
->getDatabasePlatform()
->registerDoctrineTypeMapping($type, $type);
}
}
I should probably implement Type::hasType
too to avoid conflict.
I will push a commit soon to fix this.
New tag has been released
Kindly run composer update kitloong/laravel-migrations-generator
to update.
I'm getting an
Type enum already exists
exception when trying to executemigrate:generate
and don't fully understand, what I'm missing here. See (truncated) stacktrace below.