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

  • SEARCH
  • Home
  • 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 8843097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:07:59+00:00 2026-06-14T11:07:59+00:00

In my rails app I have a model Events . It has several columns

  • 0

In my rails app I have a model Events. It has several columns which were created through following this guide https://devcenter.heroku.com/articles/export-from-heroku-postgres and then performing rake db:schema:dump.

Now I want to add some new columns to the Event model. I tried editing schema.rb and restarting the app but that didn’t seem to work. Anyone know the proper way to proceed?

—-Edit——-

Specifically I added this line to the Event model in schema.rb.

t.datetime "date_time"

When I click the link to add a event in the rails app I receive this error:

undefined method `date_time' for #<Event:0x007fdb59a87118>
  • 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. Editorial Team
    Editorial Team
    2026-06-14T11:08:01+00:00Added an answer on June 14, 2026 at 11:08 am

    The schema.rb file is a representation of the current state of the database schema, it is written by the database migration process, not read.

    If you want to add a new column, create a migration:

    $ rails generate migration AddNewEventStuff
    $ vim db/migrate/add_new_event_stuff*.rb
    

    Then add your columns:

    class AddNewEventStuff < ActiveRecord::Migration
      def change
        add_column ...
      end
    end
    

    Everything except the add_column should be there already. Once you have your migration, do a rake db:migrate and you’re done. Now you should see some changes in your schema.rb.

    See the Ruby on Rails Migration Guide for further details and different ways to build your migrations.

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

Sidebar

Related Questions

In a Rails 3.2 app I have a model Project, which has many Tasks.
In my Rails app, I have a model Page which represents one HTML article
I have a rails app (rails 3.1.3) that has a shopping cart model. I
My rails app has a simple model Links which tracks all the Urls associated
I have a Rails App in which I have hundreds of model that only
In a Rails app I have several integer attributes on a model. A user
I have a model User and Listing in my rails app. User has many
I have the following model, Purchase, on my Rails app: class Purchase < ActiveRecord::Base
I have a products model in my rails app, and with in the products
I have a Rails app with the usual application_controller, and a controller (and model)

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.