-
Notifications
You must be signed in to change notification settings - Fork 26
DBVersion
DBVersion is a database versioning tool, used to synchronize and keep track of database changes. It can also be used to make sure your development and products database are synchronized! [h2]Installation instructions[/h2] [b]1.[/b] Download DBVersion here, unzip contents to the application folder.
[b]2.[/b] Create an XML file that will be used to store the DB changes. Here's a template file with full syntax: [code] <?xml version="1.0" encoding="UTF-8"?> <![CDATA[ SELECT * FROM any_sql_data ]]>
<version id="2">
<dropColumn name="table.column" />
</version>
if(!$this->cidbversion->LatestDBVersion()) { $this->cidbversion->Synchronize(); } [/code] As you see, the LatestDBVersion() method can be used to test if the DB is up-to-date. [b]6.[/b] For every change you make on your database, update the XML file with a new version element.
[b]Remember:[/b] If something goes wrong or the XML isn't validated, no changes will be made to the DB!