DROP TABLE IF EXISTS strategy;
CREATE TABLE strategy (
    id SERIAL PRIMARY KEY,
    date DATE NOT NULL,
    name VARCHAR(64) NOT NULL,
    username VARCHAR(64) NOT NULL,
    competition VARCHAR(64) NOT NULL,
    role VARCHAR(20) NOT NULL,
    ratio REAL NOT NULL,
    annual_ret REAL NOT NULL,
    vol REAL NOT NULL,
    mdd REAL NOT NULL,
    annual_sr REAL NOT NULL,
    beta REAL NOT NULL,
    alpha REAL NOT NULL,
    var10 REAL NOT NULL,
    R2 REAL NOT NULL,
    tw BOOLEAN DEFAULT TRUE,
    comment VARCHAR(255),
    assets TEXT[] NOT NULL,
    assets_position REAL[] NOT NULL,
    notes TEXT[][]
);
CREATE INDEX idx_user ON strategy (username);

