Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 163059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:30:03+00:00 2026-05-11T11:30:03+00:00

I am trying to learn Rails by working with different packages (ActiveRecord, ActiveSupport) without

  • 0

I am trying to learn Rails by working with different packages (ActiveRecord, ActiveSupport) without rails gem.

I can’t figure out how to create a database with three classes, though. Here’s my rakefile:

require 'rubygems' require 'activerecord'    require 'yaml'     task :default => :migrate     desc 'Migrate the database through scripts in db/migrate. Target specific version with VERSION=x'    task :migrate => :environment do      ActiveRecord::Migrator.migrate('db/migrate', ENV['VERSION'] ? ENV['VERSION'].to_i : nil )    end     task :environment do      ActiveRecord::Base.establish_connection(YAML::load(File.open('database.yml')))      ActiveRecord::Base.logger = Logger.new(File.open('database.log', 'a'))    end    

And I have three files:

001_create_appearances.rb 001_create_movies.rb 001_create_actors.rb 

Which I have all run successfully in the past, each one just inherits from ActiveRecord::Migration and does self.up/self.down.

I have, however, problem, that when I run rake, it returns ‘Multiple migrations have the version number 1’. Should I pack all the migrations into one file, like 001_create_database.rb?

Is there a manual somewhere that describes how these versions work?

I tried reading source of migrator.rb but couldn’t find where up_without_benchmarks/down_without_benchmarks where located.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:30:04+00:00Added an answer on May 11, 2026 at 11:30 am

    Right. Migrations must start with unique numbers in order that you wish for them to be executed. By default in rails 2.x this number will be a representation of the current date and time.

    The reason for this is to allow developers to easily run and undo migrations. Timestamps are used instead of sequential integers in case two developers simultaneously create a new migration (Which would result in them having the same number when they are pushed to a version control system).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 80k
  • Answers 81k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Well it might all be too much trouble than it's… May 11, 2026 at 4:24 pm
  • Editorial Team
    Editorial Team added an answer Try wrapping your IF-expression in a function Function test if… May 11, 2026 at 4:24 pm
  • Editorial Team
    Editorial Team added an answer It looks like it should work, but CF does have… May 11, 2026 at 4:24 pm

Related Questions

I am trying to learn Ruby on Rails, I have followed the instructions from
I am trying to set myself up on a mac to learn Ruby on
I am a ASP.NET Developer trying to learn Rails and RESTful approach. To understand,
I am ASP.NET developer from last 5 years and still loving it. There are

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.