aboutsummaryrefslogtreecommitdiff
path: root/src/sql/upgrade-6.sql
blob: 0b25aa5576928e1b20741f7c3dbbd9fe4bfd53d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
BEGIN TRANSACTION;

ALTER TABLE Builds RENAME TO OldBuilds;

CREATE TABLE Builds (
  id            INTEGER NOT NULL PRIMARY KEY,
  derivation    TEXT NOT NULL UNIQUE,
  evaluation    INTEGER NOT NULL,
  job_name      TEXT NOT NULL,
  system        TEXT NOT NULL,
  nix_name      TEXT NOT NULL,
  log           TEXT NOT NULL,
  status        INTEGER NOT NULL,
  timestamp     INTEGER NOT NULL,
  starttime     INTEGER NOT NULL,
  stoptime      INTEGER NOT NULL,
  FOREIGN KEY (evaluation) REFERENCES Evaluations (id)
);

INSERT INTO Builds(
  id,
  derivation,
  evaluation,
  job_name,
  system,
  nix_name,
  log,
  status,
  timestamp,
  starttime,
  stoptime
) SELECT rowid,
         derivation,
         evaluation,
         job_name,
         system,
         nix_name,
         log,
         status,
         timestamp,
         starttime,
         stoptime
  FROM OldBuilds;

DROP TABLE OldBuilds;

COMMIT;