diff --git a/sql/upgrades/161.sql b/sql/upgrades/161.sql new file mode 100644 --- /dev/null +++ b/sql/upgrades/161.sql @@ -0,0 +1,17 @@ +-- SWH DB schema upgrade +-- from_version: 160 +-- to_version: 161 +-- description: Make revision.extra_headers not null + +-- latest schema version +insert into dbversion(version, release, description) + values(161, now(), 'Work Still In Progress'); + + +update revision + set extra_headers = ARRAY[][] + where extra_headers is null; + + +alter table revision + alter column extra_headers set not null; diff --git a/swh/storage/sql/30-swh-schema.sql b/swh/storage/sql/30-swh-schema.sql --- a/swh/storage/sql/30-swh-schema.sql +++ b/swh/storage/sql/30-swh-schema.sql @@ -17,7 +17,7 @@ -- latest schema version insert into dbversion(version, release, description) - values(160, now(), 'Work In Progress'); + values(161, now(), 'Work In Progress'); -- a SHA1 checksum create domain sha1 as bytea check (length(value) = 20); @@ -240,7 +240,7 @@ object_id bigserial, date_neg_utc_offset boolean, committer_date_neg_utc_offset boolean, - extra_headers bytea[][] -- extra headers (used in hash computation) + extra_headers bytea[][] not null -- extra headers (used in hash computation) ); comment on table revision is 'A revision represents the state of a source code tree at a specific point in time';