From 74484deaeed2b2287f112b96551227bb9aba591e Mon Sep 17 00:00:00 2001 From: Hafez Divandari Date: Mon, 24 Feb 2025 16:54:30 +0330 Subject: [PATCH 1/4] multi-schema database inspecting --- upgrade.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/upgrade.md b/upgrade.md index 888cb60dd1..1cc71f5204 100644 --- a/upgrade.md +++ b/upgrade.md @@ -19,6 +19,7 @@ - [Carbon 3](#carbon-3) - [Concurrency Result Index Mapping](#concurrency-result-index-mapping) +- [Multi-schema Database Inspecting](#multi-schema-database-inspecting) - [Image Validation Now Excludes SVGs](#image-validation) - [Nested Array Request Merging](#nested-array-request-merging) @@ -97,6 +98,42 @@ $result = Concurrency::run([ // ['task-1' => 2, 'task-2' => 4] ``` + +### Database + + +#### Multi-schema Database Inspecting + +**Likelihood Of Impact: Low** + +The `Schema::getTables()`, `Schema::getViews()` and `Schema::getTypes()` methods now include the results from all schemas by default. You may pass the `schema` argument to retrieve the result for the given schema only: + +```php +// All tables on all schemas... +$tables = Schema::getTables(); + +// All tables on the 'main' schema... +$table = Schema::getTables(schema: 'main'); + +// All tables on the 'main' and 'temp' schemas... +$table = Schema::getTables(schema: ['main', 'temp']); +``` + +The `Schema::getTableListing()` method now returns schema-qualified table names by default. You may pass the `schemaQualified` argument to change the behavior as desired: + +```php +$tables = Schema::getTableListing(); +// ['main.migrations', 'main.users', 'temp.foo'] + +$table = Schema::getTableListing(schema: 'main'); +// ['main.migrations', 'main.users'] + +$table = Schema::getTableListing(schema: 'main', schemaQualified: false); +// ['migrations', 'users'] +``` + +The `db:table` and `db:show` command now outputs results of all schemas on MySQL, MariaDB and SQLite, just like PostgreSQL and SQL Server. Consistent usage across all DB drivers. + ### Requests From eb98220dd67e19f78116ffc1afc72808441aeaf7 Mon Sep 17 00:00:00 2001 From: Hafez Divandari Date: Mon, 24 Feb 2025 17:04:21 +0330 Subject: [PATCH 2/4] better examples --- upgrade.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upgrade.md b/upgrade.md index 1cc71f5204..dcb9d56a2f 100644 --- a/upgrade.md +++ b/upgrade.md @@ -115,15 +115,15 @@ $tables = Schema::getTables(); // All tables on the 'main' schema... $table = Schema::getTables(schema: 'main'); -// All tables on the 'main' and 'temp' schemas... -$table = Schema::getTables(schema: ['main', 'temp']); +// All tables on the 'main' and 'blog' schemas... +$table = Schema::getTables(schema: ['main', 'blog']); ``` The `Schema::getTableListing()` method now returns schema-qualified table names by default. You may pass the `schemaQualified` argument to change the behavior as desired: ```php $tables = Schema::getTableListing(); -// ['main.migrations', 'main.users', 'temp.foo'] +// ['main.migrations', 'main.users', 'blog.posts'] $table = Schema::getTableListing(schema: 'main'); // ['main.migrations', 'main.users'] From 0e34fb87182642108467a89b02fbfd2510636aae Mon Sep 17 00:00:00 2001 From: Hafez Divandari Date: Mon, 24 Feb 2025 17:36:12 +0330 Subject: [PATCH 3/4] formatting --- upgrade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upgrade.md b/upgrade.md index dcb9d56a2f..0694a4f000 100644 --- a/upgrade.md +++ b/upgrade.md @@ -132,7 +132,7 @@ $table = Schema::getTableListing(schema: 'main', schemaQualified: false); // ['migrations', 'users'] ``` -The `db:table` and `db:show` command now outputs results of all schemas on MySQL, MariaDB and SQLite, just like PostgreSQL and SQL Server. Consistent usage across all DB drivers. +The `db:table` and `db:show` commands now output results of all schemas on MySQL, MariaDB and SQLite, just like PostgreSQL and SQL Server. Consistent usage across all DB drivers. ### Requests From 34c4fa15ae5e59304e8334e7327333283ea1a1ba Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 24 Feb 2025 09:45:43 -0600 Subject: [PATCH 4/4] upgrade guide --- upgrade.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/upgrade.md b/upgrade.md index 0694a4f000..9622366bce 100644 --- a/upgrade.md +++ b/upgrade.md @@ -19,8 +19,8 @@ - [Carbon 3](#carbon-3) - [Concurrency Result Index Mapping](#concurrency-result-index-mapping) -- [Multi-schema Database Inspecting](#multi-schema-database-inspecting) - [Image Validation Now Excludes SVGs](#image-validation) +- [Multi-Schema Database Inspecting](#multi-schema-database-inspecting) - [Nested Array Request Merging](#nested-array-request-merging) @@ -102,11 +102,11 @@ $result = Concurrency::run([ ### Database -#### Multi-schema Database Inspecting +#### Multi-Schema Database Inspecting **Likelihood Of Impact: Low** -The `Schema::getTables()`, `Schema::getViews()` and `Schema::getTypes()` methods now include the results from all schemas by default. You may pass the `schema` argument to retrieve the result for the given schema only: +The `Schema::getTables()`, `Schema::getViews()`, and `Schema::getTypes()` methods now include the results from all schemas by default. You may pass the `schema` argument to retrieve the result for the given schema only: ```php // All tables on all schemas... @@ -132,7 +132,7 @@ $table = Schema::getTableListing(schema: 'main', schemaQualified: false); // ['migrations', 'users'] ``` -The `db:table` and `db:show` commands now output results of all schemas on MySQL, MariaDB and SQLite, just like PostgreSQL and SQL Server. Consistent usage across all DB drivers. +The `db:table` and `db:show` commands now output the results of all schemas on MySQL, MariaDB, and SQLite, just like PostgreSQL and SQL Server. ### Requests