mardi 18 octobre 2016

rake db:migrate does not create table

I'm using Rails 4.2.6 and have strange error (learning rails with the HeadFirst book, project and directory name - "mebay"):

I need to create project uses only "read" of CRUD - so I run:

~/mebay $ rails generate model ad name:string description:text price:decimal seller_id:integer email:string img_url:string

Running via Spring preloader in process 8400
      invoke  active_record
   identical    db/migrate/20161018144410_create_ads.rb
   identical    app/models/ad.rb
      invoke    test_unit
   identical      test/models/ad_test.rb
   identical      test/fixtures/ads.yml

and here comes my db/migrate/20161018144410_create_ads.rb:

class CreateAds < ActiveRecord::Migration
  def change
    create_table :ads do |t|
      t.string :name
      t.text :description
      t.decimal :price
      t.integer :seller_id
      t.string :email
      t.string :img_url

      t.timestamps null: false
    end
  end
end

(looks pretty ok for me, basing on earlier projects)

Then, as I understand, I need to create database (i use sqlite):

~/mebay $ rake db:migrate

but after that, my development.sqlite3 remain empty

what am i doing wrong?

Aucun commentaire:

Enregistrer un commentaire