Welcome, Guest
Username: Password: Remember me

TOPIC: [ADDED] Updating a component

Updating a component 31 May 2014 19:21 #12462

  • dyvel
  • dyvel's Avatar
  • Offline
  • Elite Member
  • Posts: 200
  • Thank you received: 11
  • Karma: 10
Hi

When I download and install a component that is already installed on my Joomla site, then any changes I've made to the database is not being updated despite I delete the database tables affected.

I understand that the database is not being updated if the table exists but according to the file install.mysql.utf8, it should create the tables if they don't exists.
When I develop, I just delete the tables I've made changes to, and the install the component on top of the old one, so other table data is not lost. But even though the install mysql file writes: CREATE TABLE IF NOT EXISTS, then the tables is not created even though they don't exists.

They are only created if I completely uninstall the component and reinstall it.
The administrator has disabled public write access.

Updating a component 13 Oct 2014 10:03 #12693

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Hi dyvel,

I have now created a new feature to comply to this request.
In facts, there isn't any possibility to execute the same install script at install AND at update.
So, I placed it in the sql/update folder, and it works like a charm. (but it is triggerred only on version changes)

Everytime you want to upgrade your database, you just need to increase its version number in the project properties, and then delete the tables you want to upgrade manually before to update it.

For the moment, it does not take automatically in consideration your DB changes, so as you see, it will recreate automatically.

For datasets
If you have a dataset, then you can take the SQL declaration in the sql folder and exec it manually. (you only have to rename the tables prefixes.)
Coding is now a piece of cake
Last Edit: 13 Oct 2014 10:06 by admin.
The administrator has disabled public write access.
The following user(s) said Thank You: dyvel, dyoungers
Time to create page: 0.090 seconds

Get Started