Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

create table index unique rails

class CreateFoobars < ActiveRecord::Migration
  def change
    create_table :foobars do |t|
      t.string :name, index: {unique: true}
    end
  end
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #table #index #unique #rails
ADD COMMENT
Topic
Name
8+2 =