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

Freakin' Awesome!!! J-Cook is simply awesome - whether you're a highly experienced developer or complete novice whether you're building a small inventory component or a complete community solution! The beauty comes from a fast slick and reliable platform that readily provides developers with everything they'll need to build the backbone of a solid and secure component with wizards for authoring access publishing aliasing created/modified by dates... you name it COOK provides it! J-Cook really surpasses all of the 'competition' as far as MVC tools are concerned! Try love it and get cooking!
learnthrusong (JED)
          

Get Started