This project is archived and is in readonly mode.
Fix SQLite's db creation warnings
Reported by Antonio Cangiano | July 13th, 2008 @ 10:00 PM | in 2.x
Running rake db:create (or rake db:create:all) results in an error message such as, "db/development.sqlite3 already exists". The error message is always printed regardless of whether the database already existed or not.
This is due to the fact that the create_database method in railties/lib/tasks/database.rake wrongly assumes that the following two lines attempt a connection only:
ActiveRecord::Base.establish_connection(config)
ActiveRecord::Base.connection
In reality, the SQLite adapter will automatically create the database if it doesn't exist already and no errors are raised. Therefore the else clause of the begin/rescue statement is invoked every time, in turn printing the message mentioned above.
The attached patch fixes this.
Comments and changes to this ticket
-
Pascal Ehlert July 17th, 2008 @ 12:26 PM
Really annoying bug, +1 for this.
Could you please add some tests, Antonio?
-
Pratik August 21st, 2008 @ 12:49 PM
- Title changed from [PATCH] Fix SQLite's db creation warnings to Fix SQLite's db creation warnings
-
DHH September 10th, 2008 @ 05:57 AM
- State changed from new to committed
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 3938 "db/development.sqlite3 already exists" on new rails instance with "rake db:create" As mentioned, this is already a duplicate.
- 3938 "db/development.sqlite3 already exists" on new rails instance with "rake db:create" maybe this? https://rails.lighthouseapp.com/projects/899...