Ruby on Rails
Sunday, October 15, 2017
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.
On Wednesday, October 11, 2017 at 9:58:54 PM UTC+1, John Moses wrote:
-- On Wednesday, October 11, 2017 at 9:58:54 PM UTC+1, John Moses wrote:
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
endclass 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
endHas 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
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/358d15d4-55b5-43da-a843-eae63eb5ccd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment