Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here are the steps I took to finally get this working correctly.</p> <ol> <li><p>Be careful of tablename case with ColdFusion/MySql/OS X. It can really kill orm. What happens is that if the wrong case treatment is used in configuring MySql, Orm will drop a table but then be unable to recreate it because MySql still thinks the table exists but with a different case. This can be particularly frustrating as the MySql tools will not actually display the table with the wrong case, but you can still query it. This is a known issue with the MySql team. My advice is to just supply all lowercase names for your tables and to set your MySql table case configuration option to 1 (Store in lowercase, case insensitive). That seemed to work for me.</p></li> <li><p>Make sure you set your dialect orm option to "MySQLwithInnoDb"</p></li> <li><p>Set ormtype on all keys.</p></li> <li><p>Stick with int or integer and use it consistently. I went with integer.</p></li> <li><p>Occasionally restart everything/reboot.</p></li> <li><p>I took the sqltype off of the foreign key reference in News.cfc</p></li> </ol> <p>After I did all that, it finally started working as expected.</p> <p>Here is my final News.cfc</p> <pre><code>/** * Theser are the news items on the home page. * @persistent true * @accessors true * @output false * @entityname "News" * @table news */ component { property name="NewsId" type="string" fieldtype="id" ormtype="integer" generator="native" generated="insert"; property name="Teaser" type="string" sqltype="varchar(200)"; property name="Story" type="string" sqltype="varchar(500)"; property name="ProductLine" fieldtype="many-to-one" cfc="ProductLine" ormtype="integer" fkcolumn="ProductLineId" foreignkeyname="fk_productline_news"; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload