Enhancement idea: Throw error if index references a column that does not exist

I would like to discuss the idea of throwing an error if an index is added in a migration that references a column that does not exist at the time of migration. Currently in MySQL, when you add an index on a column that does not exist then MySQL will throw an error. In SQLite, no error will be thrown. The error would be encountered by the user at runtime.

Consider the following migrations:

class CreateApplications < ActiveRecord::Migration[5.1]
def change
create_table :applications do |t|
t.string :name

  t.timestamps
end

end
end

``

class CreateVersions < ActiveRecord::Migration[5.1]
def change
create_table :versions do |t|
t.string :name
t.references :application, foreign_key: true
t.index [:application, :name], unique: true

  t.timestamps
end

end
end

``

Has this ever come up for anybody else? I was considering my first contribution to the code base and thought this might be a good addition, but was hoping for a consensus before starting work.

John

Sqllite is not really apropreate fro production systems. Personaly I would use Postgres, its performance is on par with MySQL and seems more robust and fully features. i would imagine the mgrations can only throw errors from the database engine. The fact that SQLlight does not throw an error is a good reason not to use it.