Subject | Re: [firebird-support] Upgrade table structure |
---|---|
Author | Robert martin |
Post date | 2005-06-28T23:54:23Z |
Hi
We have a similar situation, every time our app is upgraded the DB
structure changes. I just know Im going to get lots of flames for this
but this is what we do......
(all automated)
If the system detects the DB structure is old we
Backup DB (in case of problems).
Build a new empty DB
Pump (using IBO pump) data from the old DB to the new DB
This gives us MANY advantages over a modify script.
1. Dead simple to maintain. No need to maintain modify DB statements.
This is especially useful as our clients are likely to skip one or more
updates.
2. Can add /delete / modify fields, triggers, procedures etc without
worrying about dependencies
Downsides
1. Slow (for a half gig DB this can take 20+ minutes). This is negated
by the fact that our updates only take place a relatively small number
of times a year.
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
Gustavo wrote:
We have a similar situation, every time our app is upgraded the DB
structure changes. I just know Im going to get lots of flames for this
but this is what we do......
(all automated)
If the system detects the DB structure is old we
Backup DB (in case of problems).
Build a new empty DB
Pump (using IBO pump) data from the old DB to the new DB
This gives us MANY advantages over a modify script.
1. Dead simple to maintain. No need to maintain modify DB statements.
This is especially useful as our clients are likely to skip one or more
updates.
2. Can add /delete / modify fields, triggers, procedures etc without
worrying about dependencies
Downsides
1. Slow (for a half gig DB this can take 20+ minutes). This is negated
by the fact that our updates only take place a relatively small number
of times a year.
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
Gustavo wrote:
>Hello:
>
>I have an application developped in Delphi 5, using Firebird and IBX.
>
>When I install a new version of my software in a PC which has installed the previous version, it frequently occurs that there are changes in the structure of some tables. What I want to do is that my application could automatically upgrade the table´s structures that changed.
>
>I summarize the possible changes and the solution I thought for each one:
>
>A new field was added: ALTER TABLE table ADD ...
>A field was discarded: ALTER TABLE table DROP ...
>A new index was added: CREATE INDEX ...
>An index was discarded: DROP INDEX ...
>A field has changed (length, etc.): I didn´t found a statement like ALTER FIELD so I though of modifying RDB$FIELDS with UPDATE statements.
>
>My question is. Is this a good way to do this? Does anyone know a better way?
>
>Thanks in advance
>
>Gustavo
>
>
>[Non-text portions of this message have been removed]
>
>
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Visit http://firebird.sourceforge.net and click the Resources item
>on the main (top) menu. Try Knowledgebase and FAQ links !
>
>Also search the knowledgebases at http://www.ibphoenix.com
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>