Welcome, Guest
Username: Password: Remember me

TOPIC: Change Primary Key

Change Primary Key 27 Mar 2012 08:52 #1739

  • coopdb
  • coopdb's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 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"
The administrator has disabled public write access.

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

  • griiettner
  • griiettner's Avatar
  • Offline
  • Senior Member
  • Posts: 73
  • Thank you received: 12
  • Karma: 8
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
The administrator has disabled public write access.

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

  • coopdb
  • coopdb's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 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.
The administrator has disabled public write access.

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

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

Is it a joomla component ?
Coding is now a piece of cake
The administrator has disabled public write access.

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

  • coopdb
  • coopdb's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 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.
The administrator has disabled public write access.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
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
The administrator has disabled public write access.
Time to create page: 0.162 seconds

Get Started