Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

create table index unique rails

class CreateFoos < ActiveRecord::Migration
  def change
    create_table :foos do |t|
      t.string :bar, :null => false

      t.index :bar, unique: true
    end
  end
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #table #index #unique #rails
ADD COMMENT
Topic
Name
7+2 =