I am new to rails. I am using Rails 4.0.0 and ruby 2.0.0. I am learning through Ruby on Rails 4 essential training by Kevin Skoglund. He uses mysql in that, but I couldn't install it, so I switched to sqlite3 and everything is working properly.
PROBLEM: I am running rake db:migrate. And it seems to run properly, but I couldn't see the tables in db in sqlite3.
DETAILS: Created the db simple_cms_development using
sqlite3 simple_cms_development.db
Configuered the project in database.yml by setting the location of simple_cms_development to 'database:' in 'development:'. And then ran
rake db:schema:dump
to connect rails to database and export schema.
Then I generated migration using model by
rails generate model User
Inside create_users.db
class CreateUsers < ActiveRecord::Migration
def up
create_table :users do |t|
t.column "first_name", :string, :limit => 25
t.string "last_name", :limit => 50
t.string "email", :default => "", :null => false
t.string "password", :limit => 40
t.timestamps
end
end
def down
drop_table :users
end
end
Then I ran migration rake db:migrate
. I got:
== DoNothingYet: migrating ================
== DoNothingYet: migrated (0.0000s) =======
== CreateUsers: migrating =================
-- create_table(:users)
-> 0.1941s
== CreateUsers: migrated (0.1951s) ========
I checked schema.rb, and it has:
ActiveRecord::Schema.define(version: 20140121101037) do
create_table "users", force: true do |t|
t.string "first_name", limit: 25
t.string "last_name", limit: 50
t.string "email", default: "", null: false
t.string "password", limit: 40
t.datetime "created_at"
t.datetime "updated_at"
end
end
Till now everything is working fine.
Then I open simple_cms_development.db in sqlite3, and try to see tables by .tables
it shows nothing, no error. It shows just another sqlite prompt. It should show schema_migrations and users. What should I do?