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 ability to create raw unique indexes for postgresql #54254

Open
wants to merge 2 commits into
base: 11.x
Choose a base branch
from

Conversation

TheDeadCode
Copy link
Contributor

@TheDeadCode TheDeadCode commented Jan 18, 2025

This PR adds a way for people to create unique keys on postgres with a value of LOWER(column) (or any other transformative sql function) into their unique key.

Example of an index statement this would now allow:
create unique index "username_unique" on "users" (LOWER(username))

This feature is fully backwards compatible since it is only enabled upon a function call and as such can be merged in 11.x.

Let me know if you require any changes!

(Also let me know if you want me to re-target this on master for 12.x instead)

… `$table->rawIndex("sql here", "index_name")` and `$table->index([DB::raw(...)], 'index_name')`.
@TheDeadCode TheDeadCode changed the title Add ability to create raw unique indexes for postgresql [11.x] Add ability to create raw unique indexes for postgresql Jan 18, 2025
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.

1 participant