문제

This is what I've tried... but for some reason "model("user").primaryKey() is still returning the old "User_Id" column...

<cfset table("user_table")>
<cfset property(name="id", column="User_Id") />
<cfset setPrimaryKey(property="id") />

UPDATE
The problem lies within the "Scaffold" plugin. It's using the "COLUMNLIST" instead of the "PROPERTYLIST"

I've repaired this and it seems to be generating properly now.

도움이 되었습니까?

해결책

Originally the question did not state that it was a problem with the Scaffold plugin. However, the solution is to just specify

<cfset property(name="id", column="User_Id") />

(as stated in the CFWHEELS documentation)

The bug itself, lies within the Scaffold plugin which uses "COLUMNLIST" to generate the HTML. The HTML is then referencing "#users.user_id#" which doesn't exist since it's now called "id".

I changed the Scaffold plugin to use "PROPERTYLIST" and now it's fine.

Very sorry for confusion!

다른 팁

Try to put only

<cfset setPrimaryKey("id") />

inside User model. After all add &reload=true to your URL. This will rebuild the application and refresh the settings.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top