Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Add support for modifying generated columns #50329

Merged
merged 12 commits into from
Mar 4, 2024

Conversation

hafezdivandari
Copy link
Contributor

Related to #48864 and #48357, this PR adds support for inspecting generated columns and fixes modifying them on SQLite and renaming them on legacy MySQL / MariaDB database.

Enhancements

  • Modifying generated columns on SQLite
  • Renaming generated columns on Legacy MySQL (< 8.0.3) and MariaDB (<10.5.2)
  • Add generation to Schema::getColumns()
    • generation (null|array):
      • type (string): Generation type: 'stored' or 'virtual'.
      • expression (string): Generation expression.

Copy link

github-actions bot commented Mar 1, 2024

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@hafezdivandari hafezdivandari marked this pull request as ready for review March 1, 2024 15:05
@hafezdivandari hafezdivandari marked this pull request as draft March 1, 2024 15:42
@hafezdivandari hafezdivandari marked this pull request as ready for review March 1, 2024 16:53
@taylorotwell taylorotwell merged commit 6f3ddc3 into laravel:master Mar 4, 2024
28 checks passed
@hafezdivandari hafezdivandari deleted the master-generated-columns branch March 4, 2024 15:15
@ccharz
Copy link

ccharz commented Mar 29, 2024

This merge request causes issues with Postgres < 12. The column "attgenerated" used in src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php was only added in PostgreSQL 12 according to https://pgpedia.info/p/pg_attribute.html

@driesvints
Copy link
Member

@hafezdivandari ^

@hafezdivandari
Copy link
Contributor Author

@driesvints Pgsql 12+ support on Laravel 11 reverted after this PR got merged. Just sent a PR #50834 to fix this.

PS: I think we should also add database test workflows for pgsql 10 and sqlsrv 2017 to Laravel 11 test suites.

@driesvints
Copy link
Member

Thanks @hafezdivandari. I agree. I'll try to get that in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants