Sha256: f3c72f7dd2ab00f5f62f79780a9fec2f8dba1d0ebdfd45d572e4a3a3401dc478
Contents?: true
Size: 888 Bytes
Versions: 9
Compression:
Stored size: 888 Bytes
Contents
module Castronaut module Support class Sample def self.create_sample_database connection = ActiveRecord::Base.establish_connection("adapter" => "sqlite3", "database" => "development.db", "timeout" => 5000) connection.connection.create_table "users", :force => true do |t| t.column :login, :string, :limit => 40 t.column :name, :string, :limit => 100, :default => '', :null => true t.column :password, :string end connection.connection.add_index :users, :login, :unique => true connection.connection.execute("INSERT INTO users (login,name,password) values ('admin', 'admin', 'admin')") connection.connection.execute("INSERT INTO users (login,name,password) values ('user', 'user', 'user')") end end end end
Version data entries
9 entries across 9 versions & 4 rubygems