How are DB changes updated after I fetch new commits

Discuss general development subjects that are not specific to a particular version like the versioning control system we use or other infrastructure.
Post Reply
Senky
Extension Customisations
Extension Customisations
Posts: 315
Joined: Thu Jul 16, 2009 4:41 pm

How are DB changes updated after I fetch new commits

Post by Senky »

Hi,
while thinking of process how could I manage another quite big project through the github, I realised I would like to create commits from live working localhost. It is not a problem to generate proper .gitignore not to include unwanted files in commits, however I realised sometimes also DB is updated.

As I try to use similar development process as phpBB uses, I started to think of this problem also with phpBB project.

Until now, I had not pushed any PR including DB changes, but I always developed them in this way: I have phpbb3/ directory on my localhost. It includes phpbb/phpbb repo. While developing for develop branch, I use config.php that connects to proper DB, and while developing for develop-olympus, it uses another config.php. I rename install/ directory so that I can use board, and before creating new commit, I rename it back to install/ so that it makes no harm.

With this proces, however, it is not possible to update DB if I download new commits my local repo is behind, or am I wrong?

How do you manage this? I did not meet with any complication, yet, however I cannot imagine how could I update my DB if needed. Is the reinstallation of board the only way?

Thanks for any reply!
User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: How are DB changes updated after I fetch new commits

Post by callumacrae »

When `DEBUG` (or possibly `DEBUG_EXTRA`, I dunno the difference) is set to true, the install directory is allowed to remain.
Made by developers, for developers!
My blog
Senky
Extension Customisations
Extension Customisations
Posts: 315
Joined: Thu Jul 16, 2009 4:41 pm

Re: How are DB changes updated after I fetch new commits

Post by Senky »

Wow it works! :) I did not know that, thanks!

Anyway, can anyone explain me that question related to DB updates when maintaining local board from git remote repo?
User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: How are DB changes updated after I fetch new commits

Post by naderman »

Can you explain what that question actually was?
Senky
Extension Customisations
Extension Customisations
Posts: 315
Joined: Thu Jul 16, 2009 4:41 pm

Re: How are DB changes updated after I fetch new commits

Post by Senky »

Well. I am developing on local board which is acually working normally. Time to time, I download and merge all commits my local board is behind of remote repo (https://github.com/phpbb/phpbb3) to be up-to-date and not push some patches with outdated code.
However, sometimes new commits change structure of DB (new tables are added, etc.) and all changes to DB are written in the installation script. It is fine, however my local board is running already and I do not reinstall it every time I merge it with the upstream. This means, my DB structure may be outdated sometimes. And now the question: how phpBB deals with it? Am I to reinstall my local development board every time DB structure changes?
User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: How are DB changes updated after I fetch new commits

Post by nickvergessen »

you can just call install/database_update.php everytime you fetch new commits. Devs try to keep the file in a state, where you can run it as often as you like
Member of the Development-TeamNo Support via PM
Post Reply