Changeset 507 for trunk/dns-1.0-1.2.sql


Ignore:
Timestamp:
05/08/13 18:53:23 (11 years ago)
Author:
Kris Deugau
Message:

/trunk

Re-re-re-review and tweak the new-database initialization dns.sql script
and the dns-1.0-1.2.sql upgrade script to ensure the resulting structure
is as close as possible to identical to minimize any possible breakage.

Creating a database with the 1.0 SQL init, then applying the 1.0-1.2
upgrade script, will result in pg_dump output with only one difference;
the setval for the sequence on user_id in the users table. Sematically,
there is no difference in the database behaviour (the first new user
created will have ID 2), but the changes make it easier to copy-paste
pg_dump schema fragments if further updates to the default schema are
required.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-1.0-1.2.sql

    r456 r507  
    4040\.
    4141 
    42 SELECT pg_catalog.setval('default_rev_records_record_id_seq', 5, false);
     42SELECT pg_catalog.setval('default_rev_records_record_id_seq', 4, true);
    4343
    4444ALTER TABLE domains ADD COLUMN changed boolean DEFAULT true NOT NULL;
     
    171171\.
    172172
     173-- and readd the primary key
     174ALTER TABLE ONLY rectypes
     175     ADD CONSTRAINT rectypes_pkey PRIMARY KEY (val, name);
     176
    173177-- Update dbversion
    174178UPDATE misc SET value='1.2' WHERE key='dbversion';
Note: See TracChangeset for help on using the changeset viewer.