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

Add support for case insensitive text columns (citext) #608

Merged

Conversation

matthewmcgarvey
Copy link
Member

Fixes #550

Usage

In a migration you'd pass the the case_sensitive: false flag to a string column to make its type citext. The citext extension must be enabled.

enable_extension "citext"

create table_for(User) do
  add name : String
  add email : String, case_sensitive: false
end

This would create the users table with a case sensitive name column and a case insensitive email column.

Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this is pretty awesome. I had never even heard of this before. I kinda want to switch my columns over to it. I assume this works on alter table as well, right?

@matthewmcgarvey
Copy link
Member Author

Yep, pretty sure we splat any extra options onto the type so it will get passed along. 🎉

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.

Support citext column type
2 participants