I am creating the following table:
create_table(:categories) do |t|
t.belongs_to :user, null: false, foreign_key: true, index: true
t.uuid :uuid, unique: true, null: true, index: true
t.string :kind, :limit => 32, null: false, index: true
t.string :category, null: false, index: true
t.datetime :deleted_at, null: true, index: true
t.timestamps null: false, index: false
t.index [:kind, :category], :unique => true
end
The first column is a foreign key and will by default be named "user_id". I want to create the column with the belongs_to but specify the column name as "created_by_user_id". How can I do this?