Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration problem #16

Open
jamesDin opened this issue Dec 16, 2011 · 2 comments
Open

Migration problem #16

jamesDin opened this issue Dec 16, 2011 · 2 comments

Comments

@jamesDin
Copy link

First of all, I love your work !!! You really did a great job.

I tried your demo, and you have a line there that suppose to do "migrate" to database:

       joli.models.migrate(current_migration_version);

Actually, it runs ONLY on the first time, when the emulator/device is cleared. On the second time when I run it again, it gives an error on line 600 (joli.js).
I checked it out and seems to be that after calling the next line:

    // use the model specified by as() first, then from()
    var model = joli.models.get(this.data.as || this.data.from);

the "model" is null.
Then it fails on line 600:

   result.push(model.newRecord().fromArray(rowData));

When I comment the "migrate", line, the application works fine. But if joli can do this, it will be simply just great!

Thanks a lot.

@sharpred
Copy link

Pulled the latest version today (25/7/12) calling getVersion() throws the error Result of expression 'model' [undefined] is not an object. at joli.js (line 643)

result.push(model.newRecord().fromArray(rowData));

Which i assume is the same error as above other than the line number

@jamesDin
Copy link
Author

jamesDin commented Aug 7, 2012

Yes, that's exactly the problem.
I wish there was a good "Data Migration" sample, I'm sure it's useful for all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants