ColdFusion 9 ORM: default does not work for strings

I am trying to create a new row property with a default value:

<cfproperty fieldtype="column" name="showIn" ormtype="string" default="credentials" notnull="true" required="false" /> 

After ORMReload (), the column is present in the database, but without a default value.


I expect:

showIn VARCHAR (255) NOT NULL DEFAULT "credentials"

I get:

showIn VARCHAR (255) NOT NULL


I am using MySQL 5.1.63 and ColdFusion 9. (Adobe)

Did I miss something?

+5
source share
1 answer

Use dbdefault instead of default :

 <cfproperty fieldtype="column" name="showIn" ormtype="string" dbdefault="credentials" notnull="true" required="false" /> 

From the documentation :

dbdefault: this sets the default value for a column in a table when exporting a schema.

+1
source

Source: https://habr.com/ru/post/1271834/


All Articles