Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Change Primary Key 27 Mar 2012 08:52 #1739

  • coopdb
  • coopdb's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
How can I change the primary key for a table in my component?
By default its the "id" field, but I have an existing table from another component where the primay key is not named "id"

Please Log in or Create an account to join the conversation.

Re: Change Primary Key 29 Mar 2012 02:49 #1774

I think this is done manually after you build your component...

At the moment, Cook does not have integration with 3rd party components
Paulo Griiettner

Please Log in or Create an account to join the conversation.

Re: Change Primary Key 29 Mar 2012 05:24 #1775

  • coopdb
  • coopdb's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
Yes, I know.
I have changed all the ID vars to the new ID name in my component, but that does not had an effect.
I see the entrys but the checkbox value in the gridview is always empty.

Please Log in or Create an account to join the conversation.

Re: Change Primary Key 30 Mar 2012 08:56 #1791

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
No, you cannot.

Is it a joomla component ?
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Re: Change Primary Key 30 Mar 2012 18:37 #1800

  • coopdb
  • coopdb's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
Its the article and category table from Mosets Tree.

I have now added the id field in the table and updated the id with the primary key id, when I add a new entry.
That works for me, but its not a good solution.

Please Log in or Create an account to join the conversation.

Re: Change Primary Key 05 Apr 2012 18:41 #1909

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
I think, you can change it in the table file first.

And then, change all the joined SQL requests that are based on id.

But maybe on other places too.
It should be possible properly...
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.061 seconds

This Component Generator is the REAL component generator. This tool is very easy to use and in a matter of minutes I was building a fully working extension. I was amazed with the end result... worth every cent...
Griiettner (JED)

         

Get Started