Problem with update

  • dream3w
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 3 months ago #6889 by dream3w
Problem with update was created by dream3w
Hi,

I wanted to update my component and I have had a error message:
1060 Duplicate column name 'kmllayer' SQL=ALTER TABLE `tudqx_zhgooglemaps_maps` ADD `kmllayer` text NOT NULL;

Now I cannot go in marker menu, I have that message:

Unknown column 'h.userorder' in 'field list' SQL=SELECT h.id,h.title,h.mapid,h.published,h.publish_up,h.publish_down,h.catid,h.icontype,h.ordering,h.rating_value,h.createdbyuser,h.access,h.userorder,c.title as category,m.title as mapname,g.title as markergroupname, usr.username, usr.name fullusername,ag.title as access_level FROM tudqx_zhgooglemaps_markers as h LEFT JOIN tudqx_categories as c on h.catid=c.id LEFT JOIN tudqx_zhgooglemaps_maps as m on h.mapid=m.id LEFT JOIN tudqx_zhgooglemaps_markergroups as g on h.markergroup=g.id LEFT JOIN tudqx_users as usr on h.createdbyuser=usr.id LEFT JOIN tudqx_viewlevels as ag ON ag.id = h.access WHERE (h.published IN (0, 1)) ORDER BY h.title asc LIMIT 0, 20

What do I need to do to fix these problems?

Regards,

Stephan

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

More
9 years 3 months ago - 9 years 3 months ago #6890 by Dima
Replied by Dima on topic Problem with update
Hi.

When you use backup-restore cycle, joomla engine can decided that some updates is not installed.
I mean that when I develop my extension, and need to alter database tables I do:
- folder com_zhgooglemap\admin\sql contains all scripts to create/modify my database tables
- file install.mysql.utf8.sql - executed only one time when you install component (if you didn't have it yet)
- folder updates contains all alters table/data when you update(upgrade) component.

When you upgrade component, joomla engine looks into updates folder for new files, and execute it. It caused table modification and new features appeared.

In your case for some reasons joomla decided that files didn't load and tries again execute it. In this case if columns exists in database table you'll get error about duplicated column, and installation stopped with error.

For example, you have the error
Code:
1060 Duplicate column name 'kmllayer' SQL=ALTER TABLE `tudqx_zhgooglemaps_maps` ADD `kmllayer` text NOT NULL;

TO FIX (for j.3.x version):
1 - get current version from JED
2 - unzip archive for j3.x
3 - open folder com_zhgooglemap\admin\sql\updates
4 - find file with string
Code:
ALTER TABLE `#__zhgooglemaps_maps` ADD `kmllayer` text NOT NULL;
5 - clear this line, save file. DO NOT delete this file, we need it (despite the fact it is empty)
6 - zip it and install it. DO NOT UNINSTALL, just only install over exist installation. It means you upgrade component
7 - if you'll get new error message (about new duplication of the other column), go to #3, ie edit new file and again install
8 - after all this steps finally you'll get new installation, and joomla will know all, that all files in this folder is loaded.

Don't forget support my developments: post review in JED , donate , help with translation ;)
Last edit: 9 years 3 months ago by Dima.

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

  • dream3w
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 11 months ago #7148 by dream3w
Replied by dream3w on topic Problem with update
Hi,
I've again a problem with update:

1060 Duplicate column name 'userorder' SQL=ALTER TABLE `tudqx_zhgooglemaps_markers` ADD `userorder` int(11) NOT NULL default '0';

If I give you FTP and Admin login, could you help me. I'm not very good to make change by myself.

Best regards,

Stephan

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

More
8 years 11 months ago #7149 by Dima
Replied by Dima on topic Problem with update
Hi

It is very easy, but if you have some troubles and can't do it by yourself, you can give me access to admin panel (I do not need ftp access).
And I'll step by step try to install last version of component as described above.

If you decide, mail me: ZhukDL@gmail.com temporary account to access

Don't forget support my developments: post review in JED , donate , help with translation ;)
The following user(s) said Thank You: dream3w

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

More
7 years 9 months ago #11002 by design219
Replied by design219 on topic Problem with update
Hi Dima, I'm having the same issue. I've tried to follow your steps, but I'm not finding the line:
"ALTER TABLE `#__zhgooglemaps_maps` ADD `kmllayer` text NOT NULL;"
in the file "install.mysql.utf8.sql"

Am I looking in the wrong place?

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

More
7 years 9 months ago #11003 by Dima
Replied by Dima on topic Problem with update
Hi.
Yes. install file - only for install component, not update.
You have to go down into sql\updates\mysql
And there are sql files. You have to find file with this clause (or part of it).
And do: open one file for edit, clear all content; save.

After that zip - try to install upgrade.
In 80% you'll get error for the same problem for the next version file, but you must not clear the other upper all versions at one time. Only one by one.

I mean that:
Your alter in version 1.1.6.sql
You open this file, override it's empty version.
Zip and upload.
You can have 2 ways
1- the other error about duplicates (next version is 1.2.2.sql)
and ALTER TABLE `#__zhgooglemaps_markers` ADD `descriptionhtml` text NOT NULL;
2- or correct installation.

It caused that:
- when you use backups, database tables won't rollback to previous definition (adding or dropping columns, indexes and so on)
- and when you rollbacks, next installation tries to do this alter table clauses, and you'll get errors (because it is exist)
- but your version can be not last and if you clear all files after 1.1.6, you'll get inconsistency my extension and it's database tables, and would have to check database tables manually.
Therefore you have to one by one clear file and try to install new version.

Correct installation (way#2) - in case, that all new version files is not installed before your backup. After correct installation your database tables will be like in install.sql file (only columns order for table can be different)

Don't forget support my developments: post review in JED , donate , help with translation ;)

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

Time to create page: 0.180 seconds
Powered by Kunena Forum