ga-wdi-boston / full-stack-project

Other
8 stars 64 forks source link

Can't find my table #986

Closed 3point14guy closed 7 years ago

3point14guy commented 7 years ago

I created my table with generate scaffold and did db:migrate, but when I go into psql and run \d, my table doesn't show up. My schema file does show that it was created.

I went over the lesson plan for rails-api one to many to find pointers, I attempted to google, but I can't seem to come up with a search string that gets me the info I am after and review of the closed issues doesn't show anything comparable to my current issue.

I am missing a step, please help me get back on track.

Jcornmanhomonoff commented 7 years ago

What database are you connected to?

3point14guy commented 7 years ago

Good question? How do I tell? It must not be the right one because I see tables for recipes, ingredients, books, etc.

Jcornmanhomonoff commented 7 years ago

When you're in the console, it's the name to the left. ie:

screen shot 2017-07-21 at 11 50 53 am

When we go into our sql-crud DB it changes from <yourname> to sql-crud

3point14guy commented 7 years ago

~/wdi/projects/groovy-movie2/back-end/rails-api-groovy-movie (master) $ psql sql-crud psql (9.6.3) Type "help" for help.

sql-crud=#

Ok, so maybe I wasn't going to quite the right place, but even under just psql, I don't see my new table.

Jcornmanhomonoff commented 7 years ago

Unless I'm misunderstanding and you've already checked there, I would try checking your main DB, not your sql-crud DB. We were using sql-crud for our lessons.

3point14guy commented 7 years ago

Yes, I just checked using just psql. I get a different list of tables but not the new one I am creating for this project. nicholaspiaskoski=# \d List of relations Schema | Name | Type | Owner
--------+--------------------+----------+------------------- public | ingredients | table | nicholaspiaskoski public | ingredients_id_seq | sequence | nicholaspiaskoski public | patients | table | nicholaspiaskoski public | patients_id_seq | sequence | nicholaspiaskoski (4 rows)

3point14guy commented 7 years ago

got it: rails-api-groovy-movie_development=# it's there