Location: PHPKode > scripts > Database metadata > readme.txt
Short description:
This class can update a database structure based on metadata in a SQL script

Detailed description:
If you deploy your webapplication to more then one server, you need to apply the same structure updates and perhaps also the same user data patches on all servers in a similar way. Did you ever wonder how you can smoothly organize this ?

This class reads a sql script with metadata, then updates the database structure accordingly and finally applies patches on user data.

A user interface for editing the metadata is not provided.
Code is written in PHP5.

Description of files:
	Main page to execute a update.
	Main class which arranges update of database structure
	Class with some generic utility methods
	Class with utility methods for metadata
	Classes with database abstraction for MySql
	Class to build a SQL INSERT or UDPATE
	File with database access config parameters
	SQL CREATE script, for the required tables

Nico den Boer
NL: www.denboer-ims.nl, hide@address.com
CZ: www.nicodenboer.com, hide@address.com
However, you are free to copy and use the code as you like ;)

1) Create a empty database dbmetadata
2) Execute the script InsertMetaData.sql
3) Open the script InsertMetaData.sql and remove all text starting from line
/* Remove the part below after initial installation */
4) Run the page update.php to see if it works :)

After installation:
1) Edit the metadata in the tables db_tables, db_fields, db_indexes
2) Create a new script InsertMetaData.sql with a full backup of db_tables, db_fields, db_indexes
3) If you have user data updates, update the page update.php with relevant patches
4) Distribute the new files update.php and InsertMetaData.sql to (the webservers of) your customers
5) Instruct your customers to run update.php (or add a auto-update function to your application to do it all automatically)

Return current item: Database metadata