diff --git a/docs/Makefile.local b/docs/Makefile.local --- a/docs/Makefile.local +++ b/docs/Makefile.local @@ -1,27 +0,0 @@ -sphinx/html: sql-autodoc images -sphinx/clean: clean-sql-autodoc clean-images -assets: sql-autodoc images - -sql-autodoc: - make -C ../sql/ doc - cp ../sql/doc/sql/db-schema.svg images/ - -images: - make -C images/ -clean-images: - make -C images/ clean - -clean: clean-sql-autodoc clean-images -clean-sql-autodoc: - make -C ../sql/ clean - -distclean: clean distclean-sql-autodoc -distclean-sql-autodoc: - make -C ../sql/ distclean - -.PHONY: sql-autodoc clean-sql-autodoc images clean-images - - -# Local Variables: -# mode: makefile -# End: diff --git a/sql/upgrades/180.sql b/sql/upgrades/180.sql --- a/sql/upgrades/180.sql +++ b/sql/upgrades/180.sql @@ -1,5 +1,5 @@ -- SWH DB schema upgrade --- from_version: 177 +-- from_version: 179 -- to_version: 180 -- description: add {,committer_}date_offset_bytes to rev/rel + raw_manifest to dir/rev/rel, part 2 diff --git a/sql/upgrades/182.sql b/sql/upgrades/182.sql new file mode 100644 --- /dev/null +++ b/sql/upgrades/182.sql @@ -0,0 +1,22 @@ +-- SWH DB schema upgrade +-- from_version: 181 +-- to_version: 182 +-- description: fix null date_offset_bytes and remove leftover function from 180.sql + +insert into dbversion(version, release, description) + values(182, now(), 'Work In Progress'); + + +update release + set date_offset_bytes='+0000'::bytea + where date is not null and date_offset_bytes is null; + +update revision + set date_offset_bytes='+0000'::bytea + where (date = 0 and date_neg_utc_offset is null and date_offset_bytes is null) + +update revision + set committer_date_offset_bytes='+0000'::bytea + where (committer_date = 0 and committer_date_neg_utc_offset is null and committer_date_offset_bytes is null) + +drop function if exists _format_offset; diff --git a/swh/storage/postgresql/db.py b/swh/storage/postgresql/db.py --- a/swh/storage/postgresql/db.py +++ b/swh/storage/postgresql/db.py @@ -30,7 +30,7 @@ """ - current_version = 181 + current_version = 182 def mktemp_dir_entry(self, entry_type, cur=None): self._cursor(cur).execute(