× This forum has been locked. Please submit new Feature Requests on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues

Key field different than "Id"

10 年 2 个月 前 #368 sergio anachoreta
Key field different than "Id" was created by sergio anachoreta
Hi.everybody.
When I create a table, many fields are automatically created, including the "id" as a key field, auto increment.  If I change this name to"product_id" for example and then generate the component, the table is created with a "id" as key field and "product_id" as a simple field.
Is it possible to create a table with a key field named different than "id", just like "product_id"?
Thanks 

Please 登录注册一个帐号 to join the conversation.

10 年 1 个月 前 #416 Omar Ramos
Replied by Omar Ramos on topic Key field different than "Id"
I tried the same thing as well and ran into the same issue...this would be a nice feature to have.

Please 登录注册一个帐号 to join the conversation.

10 年 1 个月 前 #418 Andres Maeso
Replied by Andres Maeso on topic Key field different than "Id"
Hello both!

I would move this to Feature Requests but I am afraid this request doesn't follow Joomla standards, so we won't be able to implement it.

Regards,

Andrés.

Andrés Maeso
Customer relations manager at Joomla Component Creator.

该邮件地址已受到反垃圾邮件插件保护。要显示它需要在浏览器中启用 JavaScript。

Please 登录注册一个帐号 to join the conversation.

10 年 1 个月 前 #419 Omar Ramos
Replied by Omar Ramos on topic Key field different than "Id"
Hi Andres,

It has definitely been a while since I wrote a component from scratch, but I'm pretty sure the Joomla conventions were flexible enough to accept a primary key field other than "ID", but I'll need to confirm as we continue our testing on our end.

The convention of adding the singular version of the table name as a prefix usually shows up in other databases I think (more commonly anyway), but currently the Nooku Framework uses it as well (but it uses more strongly as an actual convention for their framework).

I think the main thing, is as a user if it's not supported to modify the field name, maybe the ID field should not be allowed to be edited (so as to prevent confusion...because after I edited mine I didn't find out it wouldn't work until I buillt the component and attempted to install it and saw the SQL errors)?

Please 登录注册一个帐号 to join the conversation.

10 年 1 个月 前 #428 sergio anachoreta
Replied by sergio anachoreta on topic Key field different than "Id"
Hi Andres.
As I said before, there are many extensions using key fields rather than Id, in particular ecommerce like Virtuemart , Joomshopping and others.
If your tool allow me to use other fieldname, certainly you will increase the power of the component creator.

Please 登录注册一个帐号 to join the conversation.

10 年 1 个月 前 #438 Andres Maeso
Replied by Andres Maeso on topic Key field different than "Id"
Hi there!

Ok, I'll move it to feature requests if it's ok with you. I've also asked people via twitter in case anybody feels it's interesting too.

Thanks for your feedback!

Andrés Maeso
Customer relations manager at Joomla Component Creator.

该邮件地址已受到反垃圾邮件插件保护。要显示它需要在浏览器中启用 JavaScript。

Please 登录注册一个帐号 to join the conversation.

创建页面时间:0.060秒
核心: Kunena 论坛

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.