Best practise for schema evolution

10 views
Skip to first unread message

p.stie...@gmail.com

unread,
Dec 8, 2018, 8:02:38 PM12/8/18
to glorp-group
Hello everyone!

I'm pretty new to glorp but I'm keeping at it even though it's frustrating at times. I recently gave up on mapping from one class to a polymorphic one using the HorizontalTypeResolver as it just wouldn't work. The Filtered resolver does however work fine. The horizontal one didn't write the foreign keys as expected.

So as I settled for the Filtered resolver I started realizing that I will have to be able to evolve the database schema to account for new types. I ran across some code in GlorpSession that seems like it's intended to do the job, namely: migrateFromSystem:toSystem. There is also migrateFromVersion:toVersion: but in my image the definition is just to halt.

I was thinking about using updateTableFrom:to: but as i attempted to get my table from my descriptor: MyDescriptor new tabledNamed: 'TABLE' I just had an error saying that serial was sent to nil and in the debugger it seems that platform evaluates to nil. So...I'm not sure how to work with this.

Is there anything written somewhere about how to do schema evolution using glorp? It seems like a problem anyone would run into pretty early on.

All the best,

Peter
Reply all
Reply to author
Forward
0 new messages