[odb-users] Data migration in SQLite

Alexander Igorevich alejandro_pnz at icloud.com
Tue Dec 13 11:17:06 EST 2016


> On Dec 13, 2016, at 6:57 PM, Boris Kolpackov <boris at codesynthesis.com> wrote:
> 
> Hi Alexander,
> 
> Alexander Igorevich <alejandro_pnz at icloud.com> writes:
> 
>> Yea, I run it under debugger - it works like should works - after adding
>> new class (2nd version), running next code segment:
> 
> You shouldn't even be running this code fragment with your version
> pragma:
> 
> #pragma db model version(2, 2, open)
> 
> This says: "we support migration from oldest version 2 to current 
> version 2". So when you run your code on database version 1 you
> should get to the error condition (attempt to migrate from a
> version that is too old) rather than to try and run any migration
> steps.
> 
> What you perhaps meant is this pragma:
> 
> #pragma db model version(1, 2, open)
> 
> Boris

I’ve try it out, but it doesn’t help - if I don’t remove database, new class doesn’t created.



More information about the odb-users mailing list