create_table(:users) do |t|
t.column :first_name, :string, index: true
t.column :last_name, :string, unique: true
# Will create a "user_info_id" field of type longint with a foreign key constraint
# This reference can be null, and if the user_info is deleted then the user is deleted too.
t.references to: "user_infos", name: "user_info_id", on_delete: "cascade", null: true
# Example of creating index on full name
t.index "lower(first_name || ' ' || last_name)", using: :btree