We're a long time SQL Anywhere+Delphi development shop. A lot of our developers have come up with their own simple implementations of how to manage the version of a SQL Anywhere database schema with its related delphi application(s). However we're wanting to standardise how we do this, so thought we'd use this fantasic resource.
By manage, I mean:
So, what do other SQL Anywhere developers use to version control their schema?
We use PowerDesigner to manage the schema. The CDM and PDM Files are in a classical CVS Repository.
Each Procedures, Function and View is stored a SQL Script.
Changes to the Database are always done by a update script. This scipt uses the
All sql scripts are hold in a CVS Repository.
When we release a new version of the client Application we tag the Scripts and the PD Files in the CVS with the client version they are intended for.
We write the DDL manually based on the PDM but you can also use the DDL Script Power Designer can generate and embed them by
We use PowerDesigner too (PDM). For every build of our software there is a corresponding physical model, checked in using SourceSafe. We let PowerDesigner create differential DDL scripts to modify databases according to the changed model.
For updates we bundle the necessary scripts with a master script, that READs them im chronological order and checks against a column in a version table if it's ok to apply the changes.
For our new product line though we took another approach: all schema information is defined by meta data within the framework. Version informations including the data model are stored for each client version. For updates a wizard automatically creates all SQL statements for the target DBMS to update the client's db to the current model and generates an installer.
answered 24 Feb '10, 10:33
Since we develop 'package' software to be deployed to multiple sites, we implement schema changes via a script file to insure it is easily repeatable; the last line in that script updates a schema version setting (a particular row in a "settings" table).
We maintain an "expected schema version number" in our app and check that against the "schema version" in the db at app startup.
answered 24 Feb '10, 02:58
What program are you using to make the schema changes? DO you have a source control provider you are using with Delphi code?
answered 24 Feb '10, 14:54
We use PowerDesigner first off. Unfortunately, we don't have the Repository feature, so we handle the 'versioning' with good'ole Copy+Paste of the PDM file. We then have our application version stored in the database, and then when the application connects, it compares.
It has its faults, but it works out pretty well in the end.
answered 24 Feb '10, 01:55