0

I have a database like this in Rails :

file schema.rb

create_table "four_seasons", :force => true do |t|
    t.integer  "channel"
    t.integer  "data"
    t.datetime "created_at", :null => false
    t.datetime "updated_at", :null => false
  end

How can I create data like : channel 1 channel 2 .... channel 89? How can I reset id after deleting data? Thank for all help.

1 Answer 1

2

What about seed?

Some useful links:

http://railscasts.com/episodes/179-seed-data

http://xyzpub.com/en/ruby-on-rails/3.2/seed_rb.html

Sign up to request clarification or add additional context in comments.

1 Comment

I know how to create 1 data but I want to create it 89 times with channel increase automatically

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.