# problem with sqlite3....

**URL:** <https://discuss.rubyonrails.org/t/problem-with-sqlite3/41792>\
**Category:** rubyonrails-talk\
**Created:** [April 21, 2009, 9:32pm UTC](https://discuss.rubyonrails.org/t/problem-with-sqlite3/41792 "2009-04-21T21:32:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [April 21, 2009, 9:32pm UTC](https://discuss.rubyonrails.org/t/problem-with-sqlite3/41792/1 "2009-04-21T21:32:17Z")

</div>

Hi all,

I am relatively new to ruby and RoR. I created a simple rails proj named foo by giving command &nbsp;&nbsp;-\> rails foo --database=sqlite3 It created a new rails proj.. So in that I created a simple db class named user by using the below command &nbsp;&nbsp;-\> ruby script/generate model user so in db/migrate I got a file named 20090421211825\_create\_users.rb created. and in app/models : user.rb got created. in user.rb.. i have written like this

class User \< ActiveRecord::Base &nbsp;&nbsp;validate\_uniqueness :userid &nbsp;&nbsp;validate\_presence\_of :username end

in 20090421211825\_create\_users.rb, its like this

class CreateUsers \< ActiveRecord::Migration &nbsp;&nbsp;def self.up &nbsp;&nbsp;&nbsp;&nbsp;create\_table :users do |t| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t.integer :userid &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t.string :username, :limit =\> 32 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t.timestamps &nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;end

&nbsp;&nbsp;def self.down &nbsp;&nbsp;&nbsp;&nbsp;drop\_table :users &nbsp;&nbsp;end end

after I am done... I did rake db:migrate version=20090421211825

== CreateUsers: migrating

---

<div class="post-metadata">

**Author:** ![Frederick\_Cheung](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/frederick_cheung/32/3901_2.png) [@Frederick\_Cheung](https://discuss.rubyonrails.org/u/Frederick_Cheung)\
**Post date:** [April 21, 2009, 10:51pm UTC](https://discuss.rubyonrails.org/t/problem-with-sqlite3/41792/2 "2009-04-21T22:51:59Z")

</div>

> I got schema.rb in db/migrate specifying the CREATE statement of the USER.. now, I want to see whether my table exists in the db by just giving -\> sqlite3 SQLite version 3.4.0 Enter ".help" for instructions \> .tables \>
> 
> I am not getting my table... I don't know whats wrong with that..Am I looking into the correct place.... Did I do correctly??

You need to tell sqlite3 which database to look at - pass the path to your database file as the first argument (eg sqlite3 db/ development.sqlite3 )

Fred

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [April 21, 2009, 11:22pm UTC](https://discuss.rubyonrails.org/t/problem-with-sqlite3/41792/3 "2009-04-21T23:22:20Z")

</div>

Frederick Cheung wrote:
