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

TOPIC:

Updating a component 31 May 2014 19:21 #12462

  • dyvel
  • dyvel's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 200
  • Thank you received: 11
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.

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

Updating a component 13 Oct 2014 10:03 #12693

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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
The following user(s) said Thank You: dyvel, dyoungers

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

Last edit: by admin.
  • Page:
  • 1
Time to create page: 0.054 seconds
Great UX great performance and definitely a time saver. It only took me 10 minutes of playing around before purchasing a subscription and right now I just want to throw more money at you! I just started a new project and after just 4h I can already tell it probably saved me several days of work. I'm building a wholesale ordering system with sales rep management. I have not looked at the code yet but so far: impressive.
flip (Forum)

Get Started