Skip to content

Commit 5ef464f

Browse files
committed
firest release
1 parent fbbe28f commit 5ef464f

File tree

4 files changed

+8
-31
lines changed

4 files changed

+8
-31
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Changelog
22
=========
33

4-
1.0.0 (202x-xx-xx)
4+
1.0.0 (2023-07-03)
55
------------------
66

77
- First release

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
Laravel revert DB default string length
22
=======================================
33

4-
--------------------------------------
5-
/!\ UNFINISHED Do not use at this time
6-
--------------------------------------
7-
8-
94
This package revert database default string length to 255 characters in a Laravel project. It transforms all VARCHAR(191) columns to 255 characters.
105

116
This is especially useful for old projects that need to be updated.
@@ -19,12 +14,6 @@ Schema::defaultStringLength(191);
1914

2015
As a result, this package will be of great help to you to modernize an old application.
2116

22-
It proceeds in **X** steps:
23-
24-
1. ...
25-
2. ...
26-
3. ...
27-
2817
Instalation
2918
-----------
3019

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
],
1313
"license": "MIT",
1414
"require": {
15-
"php": "^8.0",
16-
"illuminate/support": "^8.0 || ^9.0",
17-
"illuminate/database": "^8.0 || ^9.0",
18-
"doctrine/dbal": "^3.5"
15+
"php": "^8.1",
16+
"illuminate/support": "^8.0 || ^9.0 || ^10.0",
17+
"illuminate/database": "^8.0 || ^9.0 || ^10.0",
18+
"doctrine/dbal": "^3.5 || ^3.6"
1919
},
2020
"autoload": {
2121
"psr-4": {

src/Transformer.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public function __construct(Connection $connection)
2929
$this->connection = $connection;
3030
$this->doctrineSchemaManager = $connection->getDoctrineSchemaManager();
3131
$this->schemaBuilder = $connection->getSchemaBuilder();
32+
33+
// Prevention of errors in the presence of enum type columns
34+
$this->connection->getDoctrineConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
3235
}
3336

3437
/**
@@ -42,13 +45,6 @@ public function setConsoleCommand(Command $command)
4245
$this->command = $command;
4346
}
4447

45-
/**
46-
* 1) ...
47-
* 2) ...
48-
* 3) ...
49-
*
50-
* @return void
51-
*/
5248
public function transform()
5349
{
5450
$this->extractSchemaInfos();
@@ -66,13 +62,6 @@ public function transform()
6662
}
6763
}
6864

69-
/**
70-
* On each table :
71-
* 1) ...
72-
* 2) ...
73-
*
74-
* @return void
75-
*/
7665
protected function extractSchemaInfos()
7766
{
7867
$this->stringColumnsInfo = [];
@@ -88,7 +77,6 @@ protected function extractSchemaInfos()
8877
'column' => $column->getName(),
8978
'nullable' => ! $column->getNotnull(),
9079
'default' => $column->getDefault(),
91-
'autoIncrement' => $column->getAutoincrement(),
9280
];
9381
}
9482
}

0 commit comments

Comments
 (0)