Created
March 19, 2014 20:45
-
-
Save pedrocr/9650800 to your computer and use it in GitHub Desktop.
Initializer to change the database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BASESPEC = {adapter: "sqlite3", | |
database: "db/production.sqlite3", | |
pool: 5, | |
timeout: 5000} | |
if Camerasink::BASEDIR | |
$stderr.puts "Starting the app on #{Camerasink::BASEDIR}" | |
dbfile = File.expand_path(BASESPEC[:database], Camerasink::BASEDIR) | |
ActiveRecord::Base.establish_connection BASESPEC.merge(database: dbfile) | |
ActiveRecord::Migrator.migrate("db/migrate/") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment