Actually, just like we have a CHANGELOG, we should have a MYSQL-CHANGELOG
and a POSTGRES-CHANGELOG.

Anytime the database structure changes, the necessary commands to modify
the db format should be listed in the changelog. In the same format as
your Email below.

This would be different than what got put in the db init scripts, as those
commands are for building a db from scratch, while the changelog would
consist of mostly alter table/update commands.

> Hi,
>
> I've posted that for RC6 yet but got no response: I think we should
> provide scripts to migrate the database at least between RCs, better for
> every change in cvs.
>
> These are for postgres:
> ----------------------------------------------------------------------
> -- v1.28 -> v1.29
> BEGIN TRANSACTION;
>
> ALTER TABLE messageblks ADD COLUMN is_header INT2;
> UPDATE messageblks SET is_header=0;
> ALTER TABLE messageblks ALTER COLUMN is_header SET DEFAULT '0';
> ALTER TABLE messageblks ALTER COLUMN is_header SET NOT NULL;
>
> CREATE INDEX messageblks_physmessage_is_header_idx
>        ON messageblks(physmessage_id, is_header);
>
> COMMIT;
>
> -- v1.29 -> v1.30 no changes required
>
> -- v1.30 -> v1.31
> BEGIN TRANSACTION;
>
> ALTER TABLE mailboxes ALTER COLUMN permission SET NOT NULL;
> ALTER TABLE messages ALTER COLUMN status SET DEFAULT '0';
> CREATE INDEX messages_status_notdeleted_idx ON messages(status) WHERE
> status < '2';
>
> ALTER TABLE pbsp DROP COLUMN ipnumber;
> ALTER TABLE pbsp ADD COLUMN ipnumber INET;
> ALTER TABLE pbsp ALTER COLUMN ipnumber SET DEFAULT '0.0.0.0';
> ALTER TABLE pbsp ALTER COLUMN ipnumber SET NOT NULL;
>
> COMMIT;
> ----------------------------------------------------------------------
>
> My pbsp table always has been empty that's why I've simply dropped it,
> might be a bad idea for others?
>
>
> Thomas
>

-----
"Any sufficiently advanced bug is indistinguishable
from a feature." -- Rich Kulawiec
[EMAIL PROTECTED]

Reply via email to