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.070 seconds

Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs. 

One word: Awesome.
Edwardcox (JED)
         

Get Started