Created
October 17, 2023 17:54
-
-
Save awesome/f3711611e6fa0a18bdf1e5d0fc714cbd to your computer and use it in GitHub Desktop.
`citext` pg column format is case insensitive: https://www.postgresql.org/docs/current/citext.html for ruby on rails migration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# citext pg column format is case insensitive: https://www.postgresql.org/docs/current/citext.html | |
class EnablePostgresExtensions < ActiveRecord::Migration[6.1] | |
def change | |
enable_extension 'citext' | |
end | |
end | |
class CreateFoo < ActiveRecord::Migration[6.1] | |
def change | |
create_table :foos, id: :uuid do |t| | |
t.citext :bar, null: false, index: {unique: true} | |
t.citext :bar_id, null: false, index: {unique: true} | |
t.timestamps | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment