Subject | Upgrade table structure |
---|---|
Author | Gustavo |
Post date | 2005-06-28T23:18:49Z |
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]
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]