I ran into an issue while trying to use MGU scaffolding with a table
which had a uniqueidentifer primary key. I saw Ilya Fedotov's post
"UUID as primary key" but this seemed like something Rector should
handle without any custom code. If a uniqueidentifer field has a
default value of "(newid())" then the project TO should set this
value.

I did some digging and found that due to a bug in the MSSQL
ObjectDao.cfc the field's default value is not properly set. The
problem is that the ObjectDao's getDefault method has a case statement
based on the cfDataType of the field, however the case near line 128
is for the dbDataType "uniqueidentifier." I think that case should be
updated to something like:

<cfcase value="guid">
        <cfif ReFindNoCase("'*newId()'*", arguments.sqlDefaultValue)>
                <cfreturn "##Insert(""-"",CreateUUID(),23)##" />
        <cfelse>
                <cfreturn "" />
        </cfif>
</cfcase>

I'm new to Model-Glue and Reactor so would someone care to confirm my
findings before I submit a bug?

Thanks,

--Nathan


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to