Subject Re: [firebird-support] Database structure
Author Lucas Franzen
Primoz,

Planles schrieb:

>
> 1.
> usage of primary key generation:
>
> CREATE TABLE TABLEA
> (
> FIELD1 VARCHAR(13) NOT NULL,
> FIELD2 INTEGER NOT NULL,
> FIELD3 INTEGER,
> PRIMARY KEY (FIELD1, FIELD2)
> );
>
> and
>
> CREATE TABLE TABLEA
> (
> FIELD1 VARCHAR(13) NOT NULL,
> FIELD2 INTEGER NOT NULL,
> FIELD3 INTEGER,
> CONSTRAINT PK_TABLEA PRIMARY KEY (FIELD1, FIELD2)
> );
>
> Is here the only difference in defining a name for PK or ... ?

In the first case the primary key constraint will get a system generated
name,
in the second case you'll name it on your own (which makes life easier).


> 2.
> How do you normaly handle, what to Create/Alter at customer side ?
> When you develope new version of one deployed application, new data
> structure is inside. Is it possible to know, which version of data structure
> is in fdb file ? Or do you normaly refer to application version nr. ?


Create a table that holds internal information about your database and
structure.
So you can add - for example - a DB-version number. If the cleints read
this number when they start it is quite easy not to let them do
operations that are not present witht his db-version but just added in
following versions....

Also db-updates are quite easy that way. You can have a programm that
reads the version number, does the appropriate changes and afterwards
setting the version number accordingly.

Luc.