Reputation: 11914
I'm reading the online guide of RoR and saw this piece of code for migration.
change_table: products do |t|
#some code here
t.string :part_number
t.index :part_number
#some code here
end
What is the index here? Since I already have a string column called part_number, how come it is possible to add another column with the same name but different type?
Upvotes: 0
Views: 1009
Reputation: 6485
It's saying that the part_number
will be used as an index. The column's name is not part_number
.
Upvotes: 3