Last active
July 30, 2019 09:20
Star
You must be signed in to star a gist
ActiveRecord local test 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
require 'active_record' | |
ENV['DATABASE_URL'] ||= "sqlite3:///path/to/db.sqlite3" | |
ActiveRecord::Base.establish_connection ENV['DATABASE_URL'] | |
ActiveRecord::Schema.define do | |
self.verbose = true | |
create_table(:users, force: true) do |t| | |
t.string :username, null: false, unique: true | |
t.string :email, null: false | |
t.string :password_digest, null: false | |
t.timestamps | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment