Skip to content

Conversation

ykzts
Copy link
Contributor

@ykzts ykzts commented Feb 3, 2016

Add the following syntax:

create_table :articles, force: :cascade do |t|
  t.string :title
  t.string :slug
  t.text :content
  t.index :slug, name: 'index_slug', unique: true # same as `add_index`
end

ref: ActiveRecord::ConnectionAdapters::TableDefinition#index

for reference...

Rails 5 ActiveRecord::SchemaDumper to generate a t.index. (rails/rails@99801c6)

@winebarrel
Copy link
Member

Thanks! 👍

winebarrel pushed a commit that referenced this pull request Feb 3, 2016
@winebarrel winebarrel merged commit c2b8607 into ridgepole:v0.6.4 Feb 3, 2016
@ykzts ykzts deleted the add-table-index branch February 3, 2016 12:34
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.

2 participants