-- Rename hrtype to flags (continued)

CREATE TABLE _exlog (
    dt        FLOAT   NOT NULL,
    movenum   INTEGER NOT NULL,
    ex        INTEGER NOT NULL DEFAULT 0,
    supset    INTEGER NOT NULL DEFAULT 0,
    supsetopt INTEGER NOT NULL DEFAULT 0,
    orm       FLOAT   NOT NULL DEFAULT 0,
    ttlwgt    FLOAT   NOT NULL DEFAULT 0,
    maxwgt    FLOAT   NOT NULL DEFAULT 0,
    ttlrep    FLOAT   NOT NULL DEFAULT 0,
    maxrep    FLOAT   NOT NULL DEFAULT 0,
    ttldst    FLOAT   NOT NULL DEFAULT 0,
    ttltm     INTEGER NOT NULL DEFAULT 0,
    tmstart   FLOAT   NOT NULL DEFAULT 0,
    tmend     FLOAT   NOT NULL DEFAULT 0,
    ttlcal    FLOAT   NOT NULL DEFAULT 0,
    hravg     INTEGER NOT NULL DEFAULT 0,
    hrmax     INTEGER NOT NULL DEFAULT 0,
    angle     FLOAT   NOT NULL DEFAULT 0,
    dstunit   INTEGER NOT NULL DEFAULT 0,
    wgtunit   INTEGER NOT NULL DEFAULT 0,
    descr     TEXT    NOT NULL DEFAULT "",
    color     INTEGER NOT NULL DEFAULT 0,
    ormact    FLOAT   NOT NULL DEFAULT 0,
    links     TEXT,
    caltype   INTEGER NOT NULL DEFAULT 0,
    flags     INTEGER NOT NULL DEFAULT 0,
    minwgt    FLOAT   NOT NULL DEFAULT 0,
    minrep    FLOAT   NOT NULL DEFAULT 0,
    mindst    FLOAT   NOT NULL DEFAULT 0,
    maxdst    FLOAT   NOT NULL DEFAULT 0,
    mintm     FLOAT   NOT NULL DEFAULT 0,
    maxtm     FLOAT   NOT NULL DEFAULT 0,
    PRIMARY KEY (dt,movenum)
);

INSERT INTO _exlog (dt,movenum,ex,supset,supsetopt,orm,ttlwgt,maxwgt,ttlrep,maxrep,ttldst,ttltm,tmstart,tmend,ttlcal,hravg,hrmax,angle,dstunit,wgtunit,descr,color,ormact,links,caltype,flags,minwgt,minrep,mindst,maxdst,mintm,maxtm)
  SELECT dt,movenum,ex,supset,supsetopt,orm,ttlwgt,maxwgt,ttlrep,maxrep,ttldst,ttltm,tmstart,tmend,ttlcal,hravg,hrmax,angle,dstunit,wgtunit,descr,color,ormact,links,caltype,0,minwgt,minrep,mindst,maxdst,mintm,maxtm
  FROM exlog;
  
DROP TABLE exlog;

ALTER TABLE _exlog RENAME TO exlog;
