File tree Expand file tree Collapse file tree 4 files changed +8
-31
lines changed
Expand file tree Collapse file tree 4 files changed +8
-31
lines changed Original file line number Diff line number Diff line change 11Changelog
22=========
33
4- 1.0.0 (202x-xx-xx )
4+ 1.0.0 (2023-07-03 )
55------------------
66
77- First release
Original file line number Diff line number Diff line change 11Laravel revert DB default string length
22=======================================
33
4- --------------------------------------
5- /!\ UNFINISHED Do not use at this time
6- --------------------------------------
7-
8-
94This package revert database default string length to 255 characters in a Laravel project. It transforms all VARCHAR(191) columns to 255 characters.
105
116This is especially useful for old projects that need to be updated.
@@ -19,12 +14,6 @@ Schema::defaultStringLength(191);
1914
2015As 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-
2817Instalation
2918-----------
3019
Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments