<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">We would do something like below:</div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><br><span style="color:rgb(224,0,0);font-weight:bold"><?php<br></span> <span style="color:rgb(9,30,66);font-weight:bold">require_once</span>(<span style="color:rgb(191,38,0)">'../config.inc.php'</span>);<br><span style="color:rgb(9,30,66);font-weight:bold">include_once</span>(<span style="color:rgb(191,38,0)">'vtlib/Vtiger/Module.php'</span>);<br><span style="color:rgb(9,30,66);font-weight:bold">global</span> <span style="color:rgb(0,89,223)">$adb</span>;<br><span style="color:rgb(0,89,223)">$chkField</span> = <span style="color:rgb(0,89,223)">$adb</span>-><span style="color:rgb(32,32,32)">pquery</span>(<span style="color:rgb(191,38,0)">"SELECT fieldid FROM vtiger_field where tabid = 74 and tablename='vtiger_orderitem' and columnname ='xxxxxx' and fieldlabel='XXXXXX'"</span>);<br><span style="color:rgb(9,30,66);font-weight:bold">if</span>(<span style="color:rgb(0,89,223)">$adb</span>-><span style="color:rgb(32,32,32)">num_rows</span>(<span style="color:rgb(0,89,223)">$chkField</span>) == <span style="color:rgb(101,84,192)">1</span>)<br>{<br>    <span style="color:rgb(0,89,223)">$result</span> = <span style="color:rgb(0,89,223)">$adb</span>-><span style="color:rgb(32,32,32)">pquery</span>(<span style="color:rgb(191,38,0)">"UPDATE `vtiger_field` SET fieldlabel='YYYYYYYYY' where tabid = 74 and tablename='vtiger_orderitem' and columnname = 'xxxxxx' and fieldlabel='XXXXXXXXX'"</span>);<br>    <span style="color:rgb(9,30,66);font-weight:bold">echo</span> <span style="color:rgb(191,38,0)">"Done"</span>;<br>    <span style="color:rgb(9,30,66);font-weight:bold">exit</span>;<br>}<span style="color:rgb(9,30,66);font-weight:bold">else</span>{<br>    <span style="color:rgb(9,30,66);font-weight:bold">echo</span> <span style="color:rgb(191,38,0)">"Already Executed File"</span>;<br>    <span style="color:rgb(9,30,66);font-weight:bold">exit</span>;<br>}</blockquote><div class="gmail_default" style="font-family:verdana,sans-serif"><div style="color:rgb(0,0,0);background-color:rgb(255,255,254);font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,monospace;font-size:13px;line-height:18px;white-space:pre"><br></div></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><p style="font-size:12.8px;color:rgb(80,0,80)"><span style="color:navy;font-family:Verdana,sans-serif;font-size:10pt">Martin Allen</span></p><p style="font-size:12.8px;color:rgb(80,0,80)"><b style="color:rgb(34,34,34);font-size:12.8px"><span lang="EN-US" style="font-size:10pt;font-family:Verdana,sans-serif;color:rgb(31,73,125)"><a href="https://emailrtc.voiceflex.com/?c=7b355216c4" style="color:rgb(17,85,204)" target="_blank"><span style="color:rgb(31,73,125)">>>Call me now for free<<</span></a></span></b><span style="color:navy;font-family:Verdana,sans-serif;font-size:10pt"><br></span></p><p style="font-size:12.8px;color:rgb(80,0,80)"><b style="font-size:12.8px"><span lang="EN-US" style="font-size:10pt;font-family:Verdana,sans-serif;color:rgb(51,51,153)">01392 248692 - Main Office<br>01392 690659 - Direct Line</span></b><br></p><p style="font-size:12.8px;color:rgb(80,0,80)"><b><span style="font-size:10pt;font-family:Verdana,sans-serif;color:rgb(51,51,153)"><img width="288" height="65" src="cid:image001.png@01CFC1D6.1BCFF790" alt="signature2"></span></b><span style="color:rgb(31,73,125)"></span></p><p style="font-size:12.8px;color:rgb(80,0,80)"><span lang="EN-US" style="font-size:10pt;font-family:Verdana,sans-serif;color:navy">Have you visited our website recently? <a href="http://www.clystnet.com/" style="color:rgb(17,85,204)" target="_blank">http://www.clystnet.com</a></span><span style="color:rgb(31,73,125)"></span></p><p style="font-size:12.8px;color:rgb(80,0,80)"><span lang="EN-US" style="font-size:10pt;font-family:Verdana,sans-serif;color:navy"><br></span><span lang="EN-US" style="font-size:10pt;font-family:Verdana,sans-serif;color:rgb(153,153,153)">The information in this email is confidential If you are not the intended recipient, you must not read or use that information. This email and any attachments are believed to be virus free however no responsibility is accepted by Clystnet for any loss or damage arising in any way from receipt or use thereof. Clystnet Ltd (company reg number 7164503) is based at Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX</span></p></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 27 Apr 2020 at 10:47, Sukhdev Mohan <<a href="mailto:s.mohan@myti.it">s.mohan@myti.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Hi Martin,<div><br></div><div>This sounds clean and elegant! Can you share how you log sql changes?</div><div><br><div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div>Best Regards,<br>Sukhdev Mohan<br>———————————</div><div>Cel. (+39) 320 7020345<br><a href="mailto:s.mohan@myti.it" target="_blank">Email s.mohan@myti.it</a></div><div><br></div></div><br><br>
</div>
<div><br><blockquote type="cite"><div>Il giorno 27 apr 2020, alle ore 11:09, Martin Allen <<a href="mailto:martin.allen@clystnet.com" target="_blank">martin.allen@clystnet.com</a>> ha scritto:</div><br><div><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">We maintain a Git repositories separately to the public vTiger one. <br>We found that because the public repository is the code pre-installation, then we cannot simply clone that and use it as otherwise everytime we want to update a site, it goes back to pre-installation state. So we installed a plain version of vTiger and created a repository with this code. This is left untouched, and whenever a new version of vTiger is released we update the changes to this repository so we can track all changes between each version of vTiger.<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">We have created our own .gitignore file, which prevents files and directories that can potentially be changed during day-to-day operation (after several months of trial-and-error we think we have a complete list). </div><div class="gmail_default" style="font-family:verdana,sans-serif"> <br></div><div class="gmail_default" style="font-family:verdana,sans-serif">This repository is then cloned for each new system we want to create and development can occur on each system individually. We use the following GIT branching strategy (<a href="https://nvie.com/posts/a-successful-git-branching-model/" style="font-family:Arial,Helvetica,sans-serif" target="_blank">https://nvie.com/posts/a-successful-git-branching-model/</a>)</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Our developers run VMs locally, and can develop changes and test against a development database (simple copy of the live database after installation). Each installation also has its own development site for user testing of new features, again using the development database. We have tried several methods of logging database changes in GIT (Phinx, migrations similar to Laravel) but found that simple PHP scripts that record SQL database changes seems to be best so far.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">We discovered problems with our process when installing external extensions that are encrypted etc, but procedural workarounds prevent those becoming issues.</div><div class="gmail_default" style="font-family:verdana,sans-serif">When we roll changes to the live site, we record any PHP/SQL scripts that need to be run as part of our rollout process (which depending upon the complexity may be overnight).</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">We use Vagrant/VirtualBox to run our VMs and are currently investigating the ability to include the setup files for Vagrant into the repository as well to ensure all testing is done using the same system environment etc and minimise setup time for developers. </div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><p style="font-size:12.8px;color:rgb(80,0,80)"><span style="color:navy;font-family:Verdana,sans-serif;font-size:10pt">Martin Allen</span></p><p style="font-size:12.8px;color:rgb(80,0,80)"><b style="color:rgb(34,34,34);font-size:12.8px"><span lang="EN-US" style="font-size:10pt;font-family:Verdana,sans-serif;color:rgb(31,73,125)"><a href="https://emailrtc.voiceflex.com/?c=7b355216c4" style="color:rgb(17,85,204)" target="_blank"><span style="color:rgb(31,73,125)">>>Call me now for free<<</span></a></span></b><span style="color:navy;font-family:Verdana,sans-serif;font-size:10pt"><br></span></p><p style="font-size:12.8px;color:rgb(80,0,80)"><b style="font-size:12.8px"><span lang="EN-US" style="font-size:10pt;font-family:Verdana,sans-serif;color:rgb(51,51,153)">01392 248692 - Main Office<br>01392 690659 - Direct Line</span></b><br></p><p style="font-size:12.8px;color:rgb(80,0,80)"><b><span style="font-size:10pt;font-family:Verdana,sans-serif;color:rgb(51,51,153)"><img width="288" height="65" alt="signature2"></span></b><span style="color:rgb(31,73,125)"></span></p><p style="font-size:12.8px;color:rgb(80,0,80)"><span lang="EN-US" style="font-size:10pt;font-family:Verdana,sans-serif;color:navy">Have you visited our website recently? <a href="http://www.clystnet.com/" style="color:rgb(17,85,204)" target="_blank">http://www.clystnet.com</a></span><span style="color:rgb(31,73,125)"></span></p><p style="font-size:12.8px;color:rgb(80,0,80)"><span lang="EN-US" style="font-size:10pt;font-family:Verdana,sans-serif;color:navy"><br></span><span lang="EN-US" style="font-size:10pt;font-family:Verdana,sans-serif;color:rgb(153,153,153)">The information in this email is confidential If you are not the intended recipient, you must not read or use that information. This email and any attachments are believed to be virus free however no responsibility is accepted by Clystnet for any loss or damage arising in any way from receipt or use thereof. Clystnet Ltd (company reg number 7164503) is based at Silverdown Park, Fair Oak Close, Clyst Honiton, EX5 2UX</span></p></div></div></div></div></div></div>
<span id="gmail-m_-7684319338650728747cid:83b8c098f065a275_0.1"><image001.png></span>_______________________________________________<br><a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a></div></blockquote></div><br></div></div>_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>