wesabe/grendel

Generated schema is incorrect

Opened this issue · 1 comments

Following the instructions in GETTING-STARTED, I ran:
java -jar target/grendel-${VERSION}.jar schema -c grendel.properties > setup-grendel.sql
but the generated SQL starts with:
alter table documents drop foreign key FK_DOCUMENT_TO_OWNER;
alter table links drop foreign key FK_LINK_TO_USER;
alter table links drop foreign key FK_LINK_TO_DOCUMENT;
and since those tables don't exist yet, mysql barfs when you try to run the script.

I've been poking around the source to try to figure out how to fix this, and I'm not seeing how it's being generated. Is Shore doing it?

It looks to me like the sense of the --migration flag is inverted. Add that flag and it looks like you get a full schema script.