sql: Bump to new schema version
Add the missing bits from !20 (closed)
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).
Migrated from D599 (view on Phabricator)