Skip to content

Commit

Permalink
firest release
Browse files Browse the repository at this point in the history
  • Loading branch information
forxer committed Jul 3, 2023
1 parent fbbe28f commit 5ef464f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 31 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Changelog
=========

1.0.0 (202x-xx-xx)
1.0.0 (2023-07-03)
------------------

- First release
Expand Down
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
-----------

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
18 changes: 3 additions & 15 deletions src/Transformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand All @@ -42,13 +45,6 @@ public function setConsoleCommand(Command $command)
$this->command = $command;
}

/**
* 1) ...
* 2) ...
* 3) ...
*
* @return void
*/
public function transform()
{
$this->extractSchemaInfos();
Expand All @@ -66,13 +62,6 @@ public function transform()
}
}

/**
* On each table :
* 1) ...
* 2) ...
*
* @return void
*/
protected function extractSchemaInfos()
{
$this->stringColumnsInfo = [];
Expand All @@ -88,7 +77,6 @@ protected function extractSchemaInfos()
'column' => $column->getName(),
'nullable' => ! $column->getNotnull(),
'default' => $column->getDefault(),
'autoIncrement' => $column->getAutoincrement(),
];
}
}
Expand Down

0 comments on commit 5ef464f

Please sign in to comment.