diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f761ca..e7e481a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ Changelog ========= -1.0.0 (202x-xx-xx) +1.0.0 (2023-07-03) ------------------ - First release diff --git a/README.md b/README.md index e4be461..d32311f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,6 @@ Laravel revert DB default string length ======================================= - -------------------------------------- - /!\ UNFINISHED Do not use at this time - -------------------------------------- - - This package revert database default string length to 255 characters in a Laravel project. It transforms all VARCHAR(191) columns to 255 characters. This is especially useful for old projects that need to be updated. @@ -19,12 +14,6 @@ Schema::defaultStringLength(191); As a result, this package will be of great help to you to modernize an old application. -It proceeds in **X** steps: - -1. ... -2. ... -3. ... - Instalation ----------- diff --git a/composer.json b/composer.json index fd7b64f..77470b9 100644 --- a/composer.json +++ b/composer.json @@ -12,10 +12,10 @@ ], "license": "MIT", "require": { - "php": "^8.0", - "illuminate/support": "^8.0 || ^9.0", - "illuminate/database": "^8.0 || ^9.0", - "doctrine/dbal": "^3.5" + "php": "^8.1", + "illuminate/support": "^8.0 || ^9.0 || ^10.0", + "illuminate/database": "^8.0 || ^9.0 || ^10.0", + "doctrine/dbal": "^3.5 || ^3.6" }, "autoload": { "psr-4": { diff --git a/src/Transformer.php b/src/Transformer.php index a4953b8..8da7d6c 100644 --- a/src/Transformer.php +++ b/src/Transformer.php @@ -29,6 +29,9 @@ public function __construct(Connection $connection) $this->connection = $connection; $this->doctrineSchemaManager = $connection->getDoctrineSchemaManager(); $this->schemaBuilder = $connection->getSchemaBuilder(); + + // Prevention of errors in the presence of enum type columns + $this->connection->getDoctrineConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); } /** @@ -42,13 +45,6 @@ public function setConsoleCommand(Command $command) $this->command = $command; } - /** - * 1) ... - * 2) ... - * 3) ... - * - * @return void - */ public function transform() { $this->extractSchemaInfos(); @@ -66,13 +62,6 @@ public function transform() } } - /** - * On each table : - * 1) ... - * 2) ... - * - * @return void - */ protected function extractSchemaInfos() { $this->stringColumnsInfo = []; @@ -88,7 +77,6 @@ protected function extractSchemaInfos() 'column' => $column->getName(), 'nullable' => ! $column->getNotnull(), 'default' => $column->getDefault(), - 'autoIncrement' => $column->getAutoincrement(), ]; } }