beloglazov / couchdb-scala

A purely functional Scala client for CouchDB
Apache License 2.0
65 stars 19 forks source link

Handle update in case class attributes #70

Open fedex995 opened 7 years ago

fedex995 commented 7 years ago

Hi, team! I'm having trouble updating my case classes once I already have data stores in the database. Is there a way to accomplish this? For example, I have the following case class case class Event(var date: String, delivered: Boolean, file: Option[String], name: String, imported: Boolean, interrupts: Boolean, isIdentified: Boolean) And I already have a big amount of Events stored in the db. Now I want to add an attribute to the case class. If I do so, I obviously get an upickle.Invalid$Data: Key Missing error as the new attribute isn't present in the old data. Any help?

GuyIncognito1986 commented 5 years ago

Learn to code and update your dbs properly. Version your db object case classes, have a clear path to upgrade, and write a mapper. This isn't magic land. You are a special kind of special mate.