Page MenuHomeSoftware Heritage

sql: Bump to new schema version
ClosedPublic

Authored by ardumont on Oct 25 2018, 2:38 PM.

Details

Summary

Add the missing bits from D557

Test Plan

Here's what i did:

14:36:19 softwareheritage-indexer@somerset:5434=> begin;
BEGIN
Time: 3.005 ms
14:36:21 *softwareheritage-indexer@somerset:5434=> \i sql/upgrades/116.sql
INSERT 0 1
Time: 6.508 ms
DROP TABLE
Time: 14.383 ms
CREATE TABLE
Time: 18.467 ms
COMMENT
Time: 3.777 ms
COMMENT
Time: 3.646 ms
COMMENT
Time: 3.083 ms
COMMENT
Time: 3.343 ms
COMMENT
Time: 3.326 ms
CREATE FUNCTION
Time: 10.527 ms
COMMENT
Time: 2.971 ms
CREATE FUNCTION
Time: 9.606 ms
COMMENT
Time: 11.755 ms
CREATE INDEX
Time: 13.571 ms
ALTER TABLE
Time: 14.000 ms
ALTER TABLE
Time: 18.393 ms
ALTER TABLE
Time: 5.320 ms
ALTER TABLE
Time: 6.043 ms
ALTER TABLE
Time: 4.765 ms
14:37:17 *softwareheritage-indexer@somerset:5434=> select dbversion from dbversion order by dbversion desc limit 1;
┌──────────────────────────────────────────────────────────┐
│                        dbversion                         │
├──────────────────────────────────────────────────────────┤
│ (116,"2018-10-25 12:36:21.966964+00","Work In Progress") │
└──────────────────────────────────────────────────────────┘
(1 row)

A cleaner way:

  • go to a branch holding the previous db schema version
  • rebuild schema data (not sure how now that we change our way)
  • checkout your latest development with new changes
  • execute the migration script (everything should be ok).

Diff Detail

Repository
rDCIDX Metadata indexer
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.