Appcelerator-on-Rails icon indicating copy to clipboard operation
Appcelerator-on-Rails copied to clipboard

Error running migrations

Open nicinabox opened this issue 13 years ago • 3 comments

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");

nicinabox avatar Oct 24 '11 17:10 nicinabox

On further inspection, it appears to insert the migration id into the database. Why it's crashing the whole app completely baffles me.

nicinabox avatar Oct 24 '11 19:10 nicinabox

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.

joshryan avatar Feb 05 '12 05:02 joshryan

Make sure you test this migration on the device itself. I think there were some issues reading from the migration directory.

smontgomerie avatar Feb 10 '12 23:02 smontgomerie