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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:34:14+00:00 2026-05-10T16:34:14+00:00

Rails uses the concept of migrations to deal with model changes using the ActiveRecord

  • 0

Rails uses the concept of migrations to deal with model changes using the ActiveRecord API.

CouchDB uses JSON (nested maps and arrays) to represent its model objects.

In working with CouchDB so far, I don’t see good ways of recognizing when the document’s structure has changed (other than being disciplined as a developer), or for migrating documents from an old to a new model.

Are there existing features or do you have best practices for handling model changes in CouchDB?

  • 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-10T16:34:15+00:00Added an answer on May 10, 2026 at 4:34 pm

    Time for RDBMS de-brainwashing. 🙂

    One of the biggest points of couchdb’s schema-less design is directly aimed at preventing the need for migrations. The JSON representation of objects makes it easy to just duck type your objects.

    For example, given that you have a blog type web app with posts and whatever fancy things people store in a blog. Your post documents have fields like author, title, created at, etc. Now you come along and think to yourself, ‘I should track what phase the moon is in when I publish my posts…’ you can just start adding moon_phase as an attribute to new posts.

    If you want to be complete you’d go back and add moon_phase to old posts, but that’s not strictly necessary.

    In your views, you can access moon_phase as an attribute. And it’ll be null or cause an exception or something. (Not a JS expert, I think null is the right answer)

    Thing is, it doesn’t really matter. If you feel like changing something just change it. Though make sure your views understand that change. Which in my experience doesn’t really require much.

    Also, if you’re really paranoid, you might store a version/type attribute, as in:

    {    _id: 'foo-post',    _rev: '23490AD',    type: 'post',    typevers: 0,    moon_phase: 'full' } 

    Hope that helps.

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

Sidebar

Related Questions

some books or even the rails api uses form_for ... ... submit_tag ... end
Hey--I'm writing a basic Rails app that uses the digg API. I'm trying to
I have implemented web service using rails server. The server uses rails default authentication
I am trying to build a Rails app that uses the YouTube data API
I need to put a custom hover menu from http://www.addthis.com/help/toolbox , but Rails uses
My rails website uses the open_flash_graph plugin to generate flash graphs for my clients.
I have a rails app that uses heavily js (over 1MB total). I'd like
I have a Rails app that uses STI to handle different types of Users,
I have a Rails application that uses ActiveRecordStore for sessions. I need a PHP
I am thinking of working on a Rails application that uses PostgreSQL. I have

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.