Not all SQL Update Versions being run #271

Closed
opened 2018-04-26 15:57:39 +00:00 by cpaschen · 4 comments
cpaschen commented 2018-04-26 15:57:39 +00:00 (Migrated from github.com)

Steps to reproduce the issue

Create component with several updates (i.e. added various different fields during development). This results in several entries on the SQL Update Versions page.

Expected result

When doing a 'clean' install of the component, all of the SQL Updates should be run.

Actual result

2 of the 18 update queries (which are all ALTER commands) do not get run against one table.

System information (as much as possible)

  • OS Name & Version: WAMP
  • MySql Version: 5.7.19
  • Apache Version: 2.4.27
  • PHP Version: 7.1.9
  • Joomla Version: 3.8.6
  • JCB Version: 2.7.6 Beta/Staging
  • Browser: Chrome

Additional comments

Not sure if this is due to some code that is still in progress on the staging branch but wanted to report it.
Also, the fields that had the issue are all ones that were set to 'Default' in the admin view field list. Fields that were set to display in list didn't have a problem.

I've uninstalled the component and made sure tables were all gone, then re-compiled and installed and keeps happening the same.

I can manually run the ALTER SQL against the db and it works.

The elements are added to the views and 'function' - but data isn't stored. Almost acting like this is a 'display only' field.

I'm not sure if anyone else is seeing this as I can only reproduce this with this one component.
(Is there a way that I could have set those updates to not happen?)

### Steps to reproduce the issue Create component with several updates (i.e. added various different fields during development). This results in several entries on the SQL Update Versions page. ### Expected result When doing a 'clean' install of the component, all of the SQL Updates should be run. ### Actual result 2 of the 18 update queries (which are all ALTER commands) do not get run against one table. ### System information (as much as possible) - OS Name & Version: WAMP - MySql Version: 5.7.19 - Apache Version: 2.4.27 - PHP Version: 7.1.9 - Joomla Version: 3.8.6 - JCB Version: 2.7.6 Beta/Staging - Browser: Chrome ### Additional comments Not sure if this is due to some code that is still in progress on the staging branch but wanted to report it. Also, the fields that had the issue are all ones that were set to 'Default' in the admin view field list. Fields that were set to display in list didn't have a problem. I've uninstalled the component and made sure tables were all gone, then re-compiled and installed and keeps happening the same. I can manually run the ALTER SQL against the db and it works. The elements are added to the views and 'function' - but data isn't stored. Almost acting like this is a 'display only' field. I'm not sure if anyone else is seeing this as I can only reproduce this with this one component. (Is there a way that I could have set those updates to not happen?)

Hmm this is not correct, the updates only run when you update already installed component. Hence the name updates.

IF you do a clean install the normal install SQL will run and that file should have all the correct and latest data for the database setup.

Hmm this is not correct, the updates only run when you update already installed component. Hence the name updates. IF you do a **clean** install the normal install SQL will run and that file should have all the correct and latest data for the database setup.

It could be that I am not understanding the issue... so just in case. Check that you have those fields linked to the admin view as either Default or Show in List View if you set it to be None DB then it will not be added to the sql, as the None DB removes that field from the database completely.

It could be that I am not understanding the issue... so just in case. Check that you have those fields linked to the admin view as either **Default** or **Show in List View** if you set it to be **None DB** then it will not be added to the sql, as the None DB removes that field from the database completely.

So the update SQL is to update the database of an exciting/installed component. With a fresh install the normal install file with all those correct tables and fields get executed (and installed) and so no need to update, since it is a fresh install.

So open the install.mysql.utf8.sql of your own component and check the tables, since you should see that all the correct tables and fields are set correctly in it.

So the only other issue that can cause tables to not be created is a Joomla or Database problem. JCB only sets up the data... Joomla and the Database does the work.

So the update SQL is to update the database of an exciting/installed component. With a fresh install the normal install file with all those correct tables and fields get executed (and installed) and so no need to update, since it is a fresh install. So open the [install.mysql.utf8.sql](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/admin/sql/install.mysql.utf8.sql) of your own component and check the tables, since you should see that all the correct tables and fields are set correctly in it. So the only other issue that can cause tables to not be created is a Joomla or Database problem. JCB only sets up the data... Joomla and the Database does the work.
cpaschen commented 2018-04-26 17:18:12 +00:00 (Migrated from github.com)

Sorry ... finally tracked it down and cleaned up a mess from the Admin view MySQL Add MySQL tab. Somehow I missed that the table was not deleted. After setting the Add MySQL to NO, Do a complete uninstal. Making SURE that the tables were all wiped and a fresh compile and reinstall it all worked properly.
Please close this.

Sorry ... finally tracked it down and cleaned up a mess from the Admin view MySQL Add MySQL tab. Somehow I missed that the table was not deleted. After setting the Add MySQL to NO, Do a complete uninstal. Making SURE that the tables were all wiped and a fresh compile and reinstall it all worked properly. Please close this.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#271
No description provided.