From df57df2076e257c6622c62b4c873e97e460a0acb Mon Sep 17 00:00:00 2001 From: Hafez Divandari Date: Wed, 10 Jan 2024 11:15:53 +0330 Subject: [PATCH] [11.x] Remove Doctrine DBAL --- dusk.md | 6 ------ migrations.md | 47 ++--------------------------------------------- 2 files changed, 2 insertions(+), 51 deletions(-) diff --git a/dusk.md b/dusk.md index 1ee5ba5be73..e25ebd51f04 100644 --- a/dusk.md +++ b/dusk.md @@ -173,12 +173,6 @@ The `DatabaseMigrations` trait will run your database migrations before each tes #### Using Database Truncation -Before using the `DatabaseTruncation` trait, you must install the `doctrine/dbal` package using the Composer package manager: - -```shell -composer require --dev doctrine/dbal -``` - The `DatabaseTruncation` trait will migrate your database on the first test in order to ensure your database tables have been properly created. However, on subsequent tests, the database's tables will simply be truncated - providing a speed boost over re-running all of your database migrations: after('column')` | Place the column "after" another column (MySQL). `->autoIncrement()` | Set INTEGER columns as auto-incrementing (primary key). `->charset('utf8mb4')` | Specify a character set for the column (MySQL). -`->collation('utf8mb4_unicode_ci')` | Specify a collation for the column (MySQL/PostgreSQL/SQL Server). +`->collation('utf8mb4_unicode_ci')` | Specify a collation for the column. `->comment('my comment')` | Add a comment to a column (MySQL/PostgreSQL). `->default($value)` | Specify a "default" value for the column. `->first()` | Place the column "first" in the table (MySQL). `->from($integer)` | Set the starting value of an auto-incrementing field (MySQL / PostgreSQL). `->invisible()` | Make the column "invisible" to `SELECT *` queries (MySQL). `->nullable($value = true)` | Allow NULL values to be inserted into the column. -`->storedAs($expression)` | Create a stored generated column (MySQL / PostgreSQL). +`->storedAs($expression)` | Create a stored generated column (MySQL / PostgreSQL / SQLite). `->unsigned()` | Set INTEGER columns as UNSIGNED (MySQL). `->useCurrent()` | Set TIMESTAMP columns to use CURRENT_TIMESTAMP as default value. `->useCurrentOnUpdate()` | Set TIMESTAMP columns to use CURRENT_TIMESTAMP when a record is updated (MySQL). @@ -1032,28 +1032,6 @@ When modifying a column, you must explicitly include all of the modifiers you wa $table->integer('votes')->unsigned()->default(1)->comment('my comment')->change(); }); - -#### Modifying Columns on SQLite - -If your application is utilizing an SQLite database, you must install the `doctrine/dbal` package using the Composer package manager before modifying a column. The Doctrine DBAL library is used to determine the current state of the column and to create the SQL queries needed to make the requested changes to your column: - - composer require doctrine/dbal - -If you plan to modify columns created using the `timestamp` method, you must also add the following configuration to your application's `config/database.php` configuration file: - -```php -use Illuminate\Database\DBAL\TimestampType; - -'dbal' => [ - 'types' => [ - 'timestamp' => TimestampType::class, - ], -], -``` - -> [!WARNING] -> When using the `doctrine/dbal` package, the following column types can be modified: `bigInteger`, `binary`, `boolean`, `char`, `date`, `dateTime`, `dateTimeTz`, `decimal`, `double`, `integer`, `json`, `longText`, `mediumText`, `smallInteger`, `string`, `text`, `time`, `tinyText`, `unsignedBigInteger`, `unsignedInteger`, `unsignedSmallInteger`, `ulid`, and `uuid`. - ### Renaming Columns @@ -1063,19 +1041,6 @@ To rename a column, you may use the `renameColumn` method provided by the schema $table->renameColumn('from', 'to'); }); - -#### Renaming Columns on Legacy Databases - -If you are running a database installation older than one of the following releases, you should ensure that you have installed the `doctrine/dbal` library via the Composer package manager before renaming a column: - -
- -- MySQL < `8.0.3` -- MariaDB < `10.5.2` -- SQLite < `3.25.0` - -
- ### Dropping Columns @@ -1091,11 +1056,6 @@ You may drop multiple columns from a table by passing an array of column names t $table->dropColumn(['votes', 'avatar', 'location']); }); - -#### Dropping Columns on Legacy Databases - -If you are running a version of SQLite prior to `3.35.0`, you must install the `doctrine/dbal` package via the Composer package manager before the `dropColumn` method may be used. Dropping or modifying multiple columns within a single migration while using this package is not supported. - #### Available Command Aliases @@ -1176,9 +1136,6 @@ To rename an index, you may use the `renameIndex` method provided by the schema $table->renameIndex('from', 'to') -> [!WARNING] -> If your application is utilizing an SQLite database, you must install the `doctrine/dbal` package via the Composer package manager before the `renameIndex` method may be used. - ### Dropping Indexes