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

TOPIC:

Can not update "unique" field property 19 Feb 2016 09:06 #13828

Hello,

I'm new in j-cook... and in my component's table I have made a mistake choosing "unique" checkbox for the field "published", instead of "required"...

So I have exported the component and tested on my localhost server... when I have added 2 items in this table... logically I can set "publish" status for the second item (because "unique") : sql error : Save failed with the following error: Duplicate entry '1' for key 'published'

So I have returned to j-cook to repair my mistake, unchecking "unique" field property. After I have uploaded the new version, the error persists.

Looking on mysql table definition, the "unique" field property is not changed.

I have resolved my problem "manually" with this sql "`ALTER TABLE #__jcmytablename DROP INDEX published;`

I hope this helps somebody

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

Can not update "unique" field property 19 Feb 2016 15:28 #13829

Unchecking unique is a database change, which or not installed on an update.

You can do that by following the Joomla standard: docs.joomla.org/J2.5:Managing_Component_...s_(Update_SQL_files)

Don't forget to edit the version number of your component :)
The following user(s) said Thank You: admin

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

Can not update "unique" field property 19 Feb 2016 15:58 #13830

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
In facts, when you update a cook component, you have to make the database changes manually.

I know it is a little bit boring, but cook is missing this feature.
It could be a feature that take snapshots of the database structure in order to create the versions updates.
Lot of work, but half is already done because your dataset snapshots contains the database table, so cook could reuse that and step with versions.
Another possible cool feature.

I know you have solved your problem, but for others users, in case you have multiple installations, it is recommended to make a SQL version file.
Your cook component can manage such updates, look at the Joomla documentation to understand how it works.
Coding is now a piece of cake
The following user(s) said Thank You: krasy

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

Can not update "unique" field property 23 Feb 2016 09:38 #13836

great feature for live sites,
some points would be deleted from upgrade procedure list.

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

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

  Excellent Tool ! This tool will save you a lot of time writing the same old structure. I've used others but this is really nice for a quick start. Makes a 3 hour task a 15 minute one. Thanks for this extension
dickrundell (JED)
         

Get Started