Change default primary Key

26 views
Skip to first unread message

Gatuno

unread,
Feb 28, 2013, 9:05:54 AM2/28/13
to Pluf Users
Hi!

I'm new to Pluf and I started to use Pluf_Model, but I found a
problem. The Pluf_Model always use a 'id' field.

In one of my tables, I already have a primary key column, but this key
is not an integer. Also, I need to ensure that my key (is a char (5))
is unique.

Also, I couldn't found any CHAR type in Pluf_Model (Yes, there is a
varchar, but I need a char).

What do you suggest?

Thomas Riché

unread,
Feb 28, 2013, 9:31:49 AM2/28/13
to Pluf Users
Hello Gatuno,

If you need to specify an additionnal key to your model, you can do so by adding:$this->_a['idx']
to your model.


for an example.

If you want to add CHAR type support, you need to add the corresponding classes:
you can take the varchar example:

Hope this helps.

Thomas



--
You received this message because you are subscribed to the Google Groups "Pluf Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pluf-users+...@googlegroups.com.
To post to this group, send email to pluf-...@googlegroups.com.
Visit this group at http://groups.google.com/group/pluf-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



Gatuno

unread,
Mar 5, 2013, 10:17:24 AM3/5/13
to Pluf Users
Sorry for the late response.

Wow, the char support looks pretty easy to add. I suppose that the new
'Char' clases should be put in the Pluf src folder (in their DB/Field
and Form/Field folders)

Well then, looks like that is enough for my databse model. There is
another hidden Pluf_Model field?

And thanks.

Gatuno

unread,
Mar 7, 2013, 9:01:51 AM3/7/13
to Pluf Users
One more thing,

About the Pluf_Model indexes ('idx'), I see a type normal, there is a
type 'unique'?
Reply all
Reply to author
Forward
0 new messages