cfwheels-dbmigrate-plugin
cfwheels-dbmigrate-plugin copied to clipboard
Using null argument in references() bug (MySQL)
What steps will reproduce the problem?
- MySQL database (and potentially other engines)
- Add column(s) using references() with the null argument
- Run migration script
What is the expected output? What do you see instead? I expect for the migration to run completely. Instead, it creates tables up to the point where the erroneous call appears and just stops. The interface loads back up, failing silently, with no indication of an error message or any change to the schema (though there could have been some partial changes).
Chris, I see you opened this issue originally back in 2010, does it still occur or has it been resolved?
AFAIK, the issue is still there.
This is also as issue for me, however I receive a message "Invalid default value for 'personid'"
Caused by either of the following: t.references(referenceNames="person,credential", null=false) t.references(referenceNames="person,credential", null=false, default="")
SQL generated is 'personid' INT DEFAULT NULL NOT NULL
@chapmandu
If you don't use a reference but use a .column() function for each, does it work?
Are you using the latest version of DBMigrate?
Using the snippet below works: t = createTable("mytable")' t.column(columnName="myid", columnType="integer", null=false); t.create()
I am using version 0.8.0. I upgraded to 0.8.1 and receive the same error.
MySQL Version 5.2.34. Railo 3.2.3
So the code you show works, but when you use similar code as a reference it doesn't?
On Nov 3, 2011, at 10:56 PM, Adam Chapman [email protected] wrote:
Using the snippet below works: t = createTable("mytable")' t.column(columnName="myid", columnType="integer", null=false); t.create()
I am using version 0.8.0. I upgraded to 0.8.1 and receive the same error.
MySQL Version 5.2.34. Railo 3.2.3
Reply to this email directly or view it on GitHub: https://github.com/talltroym/cfwheels-dbmigrate-plugin/issues/3#issuecomment-2626732
@talltroym : "So the code you show works, but when you use similar code as a reference it doesn't?"
Correct!
Hey I have this same problem. If I put a default value in, the migration will run, but if I just use this: t.references(referenceNames='companyproduct,productoption',null=false); it will throw an error