Appcelerator-on-Rails
Appcelerator-on-Rails copied to clipboard
Error running migrations
It loads up, runs the initial migrations, then crashes with a stack trace when it tries to update the schema_migrations version. I tried with the demo app and it seemed to work okay.
[ERROR] Error occurred calling next on a PLSqliteResultSet. SQLite error: 'constraint failed' for 'INSERT INTO schema_migrations VALUES (?)'
I've got the following at the top of my controller:
Ti.include("../include/inheritance.js");
Ti.include("../include/db.js");
Ti.include("../common/controller.js");
Ti.include("../views/lookbooks.js");
Ti.include("../models/lookbooks.js");
On further inspection, it appears to insert the migration id into the database. Why it's crashing the whole app completely baffles me.
nicinabox, I know this is quite late as I only recently discovered appcelerator on rails, however... This issue is due to a bug in the migration script where it is using a nonexistent sqlite data type 'String' when it should be 'Text' for all String related columns, including the schema state table.
I've created a fork https://github.com/joshryan/Appcelerator-on-Rails where this and another annoyance have been fixed. If I run into any other issues I'll be fixing them in that fork as well.
Make sure you test this migration on the device itself. I think there were some issues reading from the migration directory.