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 7668475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:22:22+00:00 2026-05-31T15:22:22+00:00

I am using RoR (3.2.2) and SQLite 3 (1.3.5). When I initially generate a

  • 0

I am using RoR (3.2.2) and SQLite 3 (1.3.5). When I initially generate a model I am able to successfully create a database. However, whenever I try to use the migration generator it appears to not have any issues in the command line (no errors), but when I check the database nothing has updated or changed.

For example, I create this database:

$ rails generate model User name:string email:string

db/migrate/[timestamp]_create_users.rb

class CreateUsers < ActiveRecord::Migration
  def change
    create_table :users do |t|
      t.string :name
      t.string :email

      t.timestamps
    end
  end
end

And I run a migration:

$ bundle exec rake db:migrate

So far so good, I check my database using SQLite Database Browser and everything looks as it should.

Then if I want to add an index:

$ rails generate migration add_index_to_users_email

db/migrate/[timestamp]_add_index_to_users_email.rb

class AddIndexToUsersEmail < ActiveRecord::Migration
  def change
    add_index :users, :email, unique: true
  end
end

I run a migration:

$ bundle exec rake db:migrate

And command line gives me the following:

bundle exec rake db:migrate
== AddIndexToUsersEmail: migrating ===========================================
== AddIndexToUsersEmail: migrated (0.0000s) ==================================

However, when I check my database using SQLite Database Browser it isn’t updated. I get the same results if I try to add new columns to the table, etc. The only way I have been able to do migrations is manually updating the database using the SQLite Database Browser. Any help as to why it is not working through Rails and the command line would be greatly appreciated.

Here is my gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.2'
gem 'bootstrap-sass', '2.0.0'

group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.8.1'
gem 'annotate', '~> 2.4.1.beta'
end

group :assets do
gem 'sass-rails',   '3.2.4'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.0'

group :test do
gem 'capybara', '1.1.2'
end

group :production do
gem 'pg', '0.12.2'
end

Database.yml

development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000

test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000

production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000

Example of successfully adding a column:

 rails generate migration add_password_digest_to_users password_digest:string
  invoke  active_record
  create    db/migrate/20120318235656_add_password_digest_to_users.rb
 $ subl db/migrate/[timestamp]_add_password_digest_to_users.rb
 $ bundle exec rake db:migrate
 ==  AddPasswordDigestToUsers: migrating =======================================
 -- add_column(:users, :password_digest, :string)   -> 0.0008s
 ==  AddPasswordDigestToUsers: migrated (0.0009s) ==============================

Example of unsuccessfully adding a column:

 $ rails generate migration add_remember_token_to_users
  invoke  active_record
  create    db/migrate/20120319010623_add_remember_token_to_users.rb
 $ subl db/migrate/[timestamp]_add_remember_token_to_users.rb
 $ bundle exec rake db:migrate
 ==  AddRememberTokenToUsers: migrating ========================================
 ==  AddRememberTokenToUsers: migrated (0.0000s) ===============================

Notice when it fails to update the database the migration time is zero. I’m not sure what I am doing wrong. Thanks in advance for any suggestions.

  • 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-05-31T15:22:23+00:00Added an answer on May 31, 2026 at 3:22 pm

    I think what happens is you get the syntax slightly wrong (it’s insanely tricky) then you get an empty migration which doesn’t do anything.

    I would double check that the actual migration file has add column. I often end up manually putting the actual change (or up/down) in.

    As t Harrison says, adding an index is more subtle – as you sure it doesn’t get added if you refresh the sqlite borwser. The examples you gave that worked… are to add columns…

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

Sidebar

Related Questions

I'm using the SQlite package to interface with a database from R. However, I'm
I'd like to be able to describe different types of a model using RoR
I'm using RoR + acts_as_solr to query a Solr database. I'm used to using
I'm using RoR 3.1 and Twitter Bootstrap, and want to create a button that
Using Ruby/RoR - The year is a string in the model/view. How do I
I have doing some POC in Ruby-on-Rails and using sqlite database, while doing this
I am using RoR 3 to create a new website for myself. I have
I have the following Rake file. Using RoR 2.3.8. desc Create shops sitemap task(:shops
I am interested in using/learning RoR in a project where I have to use
The whole thing works perfectly, except image won't show, no errors, Using RoR. What

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.