realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

Domain-specific language for migrations #1977

Open kneth opened 8 years ago

kneth commented 8 years ago

Instead of specifying migration as Java code, a simple domain-specific language could be useful. The migrations can then be specified as assets.

See #1919.

NikoYuwono commented 8 years ago

I think this is a really good idea, since we can use it across platform. For starters I have one question, does the API naming in realm-cocoa and realm-swift also have same standard?

For example in the Java API function to add new column in a table called addField() but deep inside in the table class (I guess it follows the native function name?) it's called addColumn()

Since one of the purpose of creating this domain-specific language is to make this migration schema reusable, I think we need to use something that everyone familiar with.

cmelchior commented 8 years ago

That would be one of the challenges solving this issue would be about. The the idea is good, but it is also not trivial to implement.

AndyDentFree commented 8 years ago

I think a DSL as a very limited (non-looping) set of transforms makes sense, as proposed on the Schema and Migration page.