<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Poll: How do you version control your schema? in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818756#M4849599</link>
    <description>&lt;P&gt;We use PowerDesigner to manage the schema. The CDM and PDM Files are in a classical CVS Repository.&lt;/P&gt;

&lt;P&gt;Each Procedures, Function and View is stored a SQL Script. &lt;/P&gt;

&lt;P&gt;Changes to the Database are always done by a update script. This scipt uses the &lt;CODE&gt;read&lt;/CODE&gt; statement to load the scripts and updates the schema. Complex DDL (aka add fields, new tables ) is also scripted in the update file. Each update script is intended to update a database from version x to y. If you have a Database Version v you have to run update w, x and y to get to the current version.&lt;/P&gt;

&lt;P&gt;All sql scripts are hold in a CVS Repository. &lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;

&lt;H2&gt;Update_x_zzz.sql&lt;/H2&gt;

&lt;LI-CODE lang="sql"&gt;-- --------------------------------------------------------------
-- Update.sql
-- Updates the database from x.yyy to x.zzz
-- $Id$
-- --------------------------------------------------------------

SETTING_CheckSchemaVersion('x.yyy');

-- ==============================================================
message 'DDL Changes' type info to client;
-- ==============================================================

-- ==============================================================
message 'TRIGGER' type info to client;
-- ==============================================================

-- ==============================================================
message 'STORED PROCEDURES' type info to client;
-- ==============================================================

-- ==============================================================
message 'FUNCTIONS' type info to client;
-- ==============================================================

-- ==============================================================
message 'User-defined error messages' type info to client;
-- ==============================================================

read "..\\reload\\UserDefinedError.sql";

-- ==============================================================
message 'User-defined views' type info to client;
-- ==============================================================

-- ==============================================================
-- Update schema version in the SETTING table
-- ==============================================================
insert into SETTING (SET_VARNAME, SET_VALUE, SET_TYPE)
on existing update
values ('SCHEMA_VERSION', 'x.zzz', 'S');

commit;

-- ==============================================================
message 'Data Changes' type info to client;
-- ==============================================================

commit;
&lt;/LI-CODE&gt;

&lt;P&gt;The function &lt;CODE&gt;SETTING_CheckSchemaVersion&lt;/CODE&gt; raises an error when the version in the Database is not equal to what we expect.&lt;/P&gt;

&lt;P&gt;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 &lt;CODE&gt;read "pdchanges.sql"&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2010 07:23:58 GMT</pubDate>
    <dc:creator>thomas_duemesnil</dc:creator>
    <dc:date>2010-02-24T07:23:58Z</dc:date>
    <item>
      <title>Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaq-p/13818753</link>
      <description>&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;By manage, I mean:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;For this particular version of our application in our version control system this is the version of the database schema it is designed to work with.&lt;/LI&gt;
&lt;LI&gt;Using version control to track the change of a table, view, sproc, etc. over time.&lt;/LI&gt;
&lt;LI&gt;Match changes to the schema to the related changes to the application.  E.g. we added purchase ordering to our application, what specific changes to the database were required.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;So, what do other SQL Anywhere developers use to version control their schema?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2010 00:59:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaq-p/13818753</guid>
      <dc:creator>former_SQLA_member1694882</dc:creator>
      <dc:date>2010-02-24T00:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818754#M4849597</link>
      <description>&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;It has its faults, but it works out pretty well in the end.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2010 01:55:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818754#M4849597</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-24T01:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818755#M4849598</link>
      <description>&lt;P&gt;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).&lt;/P&gt;

&lt;P&gt;We maintain an "expected schema version number" in our app and check that against the "schema version" in the db at app startup.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2010 02:58:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818755#M4849598</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-24T02:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818756#M4849599</link>
      <description>&lt;P&gt;We use PowerDesigner to manage the schema. The CDM and PDM Files are in a classical CVS Repository.&lt;/P&gt;

&lt;P&gt;Each Procedures, Function and View is stored a SQL Script. &lt;/P&gt;

&lt;P&gt;Changes to the Database are always done by a update script. This scipt uses the &lt;CODE&gt;read&lt;/CODE&gt; statement to load the scripts and updates the schema. Complex DDL (aka add fields, new tables ) is also scripted in the update file. Each update script is intended to update a database from version x to y. If you have a Database Version v you have to run update w, x and y to get to the current version.&lt;/P&gt;

&lt;P&gt;All sql scripts are hold in a CVS Repository. &lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;

&lt;H2&gt;Update_x_zzz.sql&lt;/H2&gt;

&lt;LI-CODE lang="sql"&gt;-- --------------------------------------------------------------
-- Update.sql
-- Updates the database from x.yyy to x.zzz
-- $Id$
-- --------------------------------------------------------------

SETTING_CheckSchemaVersion('x.yyy');

-- ==============================================================
message 'DDL Changes' type info to client;
-- ==============================================================

-- ==============================================================
message 'TRIGGER' type info to client;
-- ==============================================================

-- ==============================================================
message 'STORED PROCEDURES' type info to client;
-- ==============================================================

-- ==============================================================
message 'FUNCTIONS' type info to client;
-- ==============================================================

-- ==============================================================
message 'User-defined error messages' type info to client;
-- ==============================================================

read "..\\reload\\UserDefinedError.sql";

-- ==============================================================
message 'User-defined views' type info to client;
-- ==============================================================

-- ==============================================================
-- Update schema version in the SETTING table
-- ==============================================================
insert into SETTING (SET_VARNAME, SET_VALUE, SET_TYPE)
on existing update
values ('SCHEMA_VERSION', 'x.zzz', 'S');

commit;

-- ==============================================================
message 'Data Changes' type info to client;
-- ==============================================================

commit;
&lt;/LI-CODE&gt;

&lt;P&gt;The function &lt;CODE&gt;SETTING_CheckSchemaVersion&lt;/CODE&gt; raises an error when the version in the Database is not equal to what we expect.&lt;/P&gt;

&lt;P&gt;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 &lt;CODE&gt;read "pdchanges.sql"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2010 07:23:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818756#M4849599</guid>
      <dc:creator>thomas_duemesnil</dc:creator>
      <dc:date>2010-02-24T07:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818757#M4849600</link>
      <description>&lt;P&gt;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. &lt;/P&gt;

&lt;P&gt;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.   &lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2010 10:33:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818757#M4849600</guid>
      <dc:creator>reimer_pods</dc:creator>
      <dc:date>2010-02-24T10:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818758#M4849601</link>
      <description>&lt;P&gt;What program are you using to make the schema changes? DO you have a source control provider you are using with Delphi code?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2010 14:54:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818758#M4849601</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-24T14:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818759#M4849602</link>
      <description>&lt;P&gt;Hi Roland.  We generally just use Sybase Central to make the changes, however a lot of the developers then cut'n'paste the changes to a db update script.  We use subversion as a VCS.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 03:26:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818759#M4849602</guid>
      <dc:creator>former_SQLA_member1694882</dc:creator>
      <dc:date>2010-02-25T03:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818760#M4849603</link>
      <description>&lt;P&gt;Thanks for your answer Reimer.  We've never used PowerDesigner and Sybase's website is, well, less than clear.  It appears to be targeted more towards your PHB.  Can you script PowerDesigner to create those DDL change scripts?  Part of this exercise is to also automate as much as possible.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 03:29:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818760#M4849603</guid>
      <dc:creator>former_SQLA_member1694882</dc:creator>
      <dc:date>2010-02-25T03:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818761#M4849604</link>
      <description>&lt;P&gt;Wooops - that should read "copy'n'paste".&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 03:31:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818761#M4849604</guid>
      <dc:creator>former_SQLA_member1694882</dc:creator>
      <dc:date>2010-02-25T03:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818762#M4849605</link>
      <description>&lt;P&gt;Thanks for the answer TDuemesnil.  How do you get the changes into the sql script?  Does each developer do it manually?  And what if there are versioning issues with a PowerDesigner schema when it comes time to commit it to your CVS repo?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 03:33:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818762#M4849605</guid>
      <dc:creator>former_SQLA_member1694882</dc:creator>
      <dc:date>2010-02-25T03:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818763#M4849606</link>
      <description>&lt;P&gt;Each Developer works on his own update main script. When he has finished his work he has to checkout all changes done by others. We use &lt;A href="http://winmerge.org/"&gt;http://winmerge.org/&lt;/A&gt; and &lt;A href="http://www.tortoisecvs.org"&gt;http://www.tortoisecvs.org&lt;/A&gt; to check for conflicts in changes. Then he can finalize his update script and check in all changes. PowerDesigner has its own Compare and Merge Model possibilities. You have to have the old and new version available to use them.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 07:22:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818763#M4849606</guid>
      <dc:creator>thomas_duemesnil</dc:creator>
      <dc:date>2010-02-25T07:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818764#M4849607</link>
      <description>&lt;P&gt;As you use subversion you know &lt;A href="http://tortoisesvn.net"&gt;http://tortoisesvn.net&lt;/A&gt; ?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 07:26:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818764#M4849607</guid>
      <dc:creator>thomas_duemesnil</dc:creator>
      <dc:date>2010-02-25T07:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818765#M4849608</link>
      <description>&lt;P&gt;Sure and we use that.  You indicated you have multiple update scripts which are applied to the db.  How do you know in which order to run the script as there could be dependencies among the different scripts?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 07:59:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818765#M4849608</guid>
      <dc:creator>former_SQLA_member1694882</dc:creator>
      <dc:date>2010-02-25T07:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818766#M4849609</link>
      <description>&lt;P&gt;Congratulations to Roland: The first SQLA user to use an "Answer" to ask a question. I don't think that's going to become common practice BUT I SEE NOTHING WRONG WITH IT. In this case Roland's question is larger in scope than the usual question-about-a-question that's posted as a comment to the original question. Anyway, SQLA ain't StackOverflow... over there, you get tarred and feathered for deviating from The Rules &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 08:26:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818766#M4849609</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2010-02-25T08:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818767#M4849610</link>
      <description>&lt;P&gt;@Nick: You can edit a comment by deleting-and-re-adding it. And you delete a comment by clicking on the X which appears when you hover over the comment text.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 08:28:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818767#M4849610</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2010-02-25T08:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818768#M4849611</link>
      <description>&lt;P&gt;Nick, I'm not really a PD expert and can't answer that question. You might want to post your question in the newsgroup sybase.public.powerdesigner.general.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 08:37:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818768#M4849611</guid>
      <dc:creator>reimer_pods</dc:creator>
      <dc:date>2010-02-25T08:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818769#M4849612</link>
      <description>&lt;P&gt;Generating an update script from the differences of two models is easily done with a few clicks. As we don't do that more than once or twice a month we never considered automation.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 08:37:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818769#M4849612</guid>
      <dc:creator>reimer_pods</dc:creator>
      <dc:date>2010-02-25T08:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Poll: How do you version control your schema?</title>
      <link>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818770#M4849613</link>
      <description>&lt;P&gt;I'll try not to Answer by posting a Question.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 17:09:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/poll-how-do-you-version-control-your-schema/qaa-p/13818770#M4849613</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-25T17:09:58Z</dc:date>
    </item>
  </channel>
</rss>

