Page MenuHomeSoftware Heritage

161: Fix sql upgrade script
ClosedPublic

Authored by ardumont on Aug 24 2020, 4:45 PM.

Details

Summary

Prior to this commit, the existing script did not work:

swh=> rollback; begin; update revision set extra_headers = ARRAY[][] where extra_headers is null;
ROLLBACK
BEGIN
ERROR:  syntax error at or near "["
LINE 1: update revision set extra_headers = ARRAY[][] where extra_he...

With the following diff's content, on staging:

swh=> rollback; begin; update revision set extra_headers = ARRAY[]::bytea[][] where extra_headers is null;
ROLLBACK
BEGIN
UPDATE 865732
swh=> select extra_headers from revision where extra_headers = ARRAY[]::bytea[][] limit 10;
 extra_headers
 ---------------
  {}
...

I guess it's kinda related to T2524 ;)

Test Plan

manual run on staging prior to actually deploy on production

Diff Detail

Repository
rDSTO Storage manager
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14752
Build 22734: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 22733: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Aug 24 2020, 4:49 PM

Build is green

Patch application report for D3833 (id=13492)

Rebasing onto f570f9336c...

First, rewinding head to replay your work on top of it...
Applying: 161: Fix sql upgrade script
Changes applied before test
commit 1ce82b790cc48e7495f8694bbbb16d41a503e5f9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Aug 24 16:38:08 2020 +0200

    161: Fix sql upgrade script
    
    Related to T2524

See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/854/ for more details.

Build is green

Patch application report for D3833 (id=13508)

Rebasing onto cc33dd3596...

Current branch diff-target is up to date.
Changes applied before test
commit f3870dcd07dc39838278aef6365e3ed8a6e0b261
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Aug 24 16:38:08 2020 +0200

    161: Fix sql upgrade script
    
    Related to T2524

See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/865/ for more details.

This revision was automatically updated to reflect the committed changes.