Note that there are some explanatory texts on larger screens.

plurals
  1. POHeroku only initializes some of my models
    primarykey
    data
    text
    <p>So I ran </p> <pre><code> heroku db:push </code></pre> <p>And it returned</p> <pre><code> Sending schema Schema: 100% |==========================================| Time: 00:00:08 Sending indexes schema_migrat: 100% |==========================================| Time: 00:00:00 projects: 100% |==========================================| Time: 00:00:00 tasks: 100% |==========================================| Time: 00:00:00 users: 100% |==========================================| Time: 00:00:00 Sending data 8 tables, 70,551 records groups: 100% |==========================================| Time: 00:00:00 schema_migrat: 100% |==========================================| Time: 00:00:00 projects: 100% |==========================================| Time: 00:00:00 tasks: 100% |==========================================| Time: 00:00:02 authenticatio: 100% |==========================================| Time: 00:00:00 articles: 100% |==========================================| Time: 00:08:27 users: 100% |==========================================| Time: 00:00:00 topics: 100% |==========================================| Time: 00:01:22 Resetting sequences </code></pre> <p>And when I went to </p> <pre><code> heroku console </code></pre> <p>This worked</p> <pre><code> &gt;&gt; Task =&gt; Task(id: integer, topic: string, content: string, </code></pre> <p>This worked </p> <pre><code> &gt;&gt; User =&gt; User(id: integer, name: string, email: string, </code></pre> <p>But the rest only returned something like </p> <pre><code> &gt;&gt; Project NameError: uninitialized constant Project /home/heroku_rack/lib/console.rb:150 /home/heroku_rack/lib/console.rb:150:in `call' /home/heroku_rack/lib/console.rb:28:in `call' &gt;&gt; Authentication NameError: uninitialized constant Authentication /home/heroku_rack/lib/console.rb:150 /home/heroku_rack/lib/console.rb:150:in `call' </code></pre> <p><strong>update 1:</strong></p> <p>And when I typed </p> <pre><code> &gt;&gt; ActiveRecord::Base.connection.tables </code></pre> <p>it returned </p> <pre><code> =&gt; ["projects", "groups", "tasks", "topics", "articles", "schema_migrations", "authentications", "users"] </code></pre> <p>Using heroku's SQL console plugin </p> <p>I got </p> <pre><code> SQL&gt; show tables +-------------------+ | table_name | +-------------------+ | authentications | | topics | | groups | | projects | | schema_migrations | | tasks | | articles | | users | +-------------------+ </code></pre> <p>So I think they are existing in heroku's database already.</p> <p>There is probably something wrong with rack db:migrate</p> <p><strong>update 2:</strong></p> <p>I ran rack db:migrate locally in both production and development modes and nothing wrong happened.</p> <p>But when I ran it on heroku it only returned:</p> <pre><code> $ heroku rake db:migrate (in /disk1/home/slugs/389817_1c16250_4bf2-f9c9517b-bdbd-49d9-8e5a-a87111d3558e/mnt) $ </code></pre> <p>Also, I am using sqlite3</p> <p><strong>update 3:</strong></p> <p>so I opened up heroku console and typed in the following command </p> <pre><code>class Authentication &lt; ActiveRecord::Base;end </code></pre> <p>Amazingly I was able to call Authentication class, but once I exited, nothing was changed.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload