-- drop tables here
DROP TABLE IF EXISTS FormEntries;
DROP TABLE IF EXISTS TacticInfo;

CREATE TABLE FormEntries(name varchar, description varchar);

CREATE TABLE Team(
    id integer PRIMARY KEY AUTOINCREMENT,
    name varchar,
    picture varchar,
    mainColor numeric,
    secondColor numeric
);

CREATE TABLE Participate(
    idTeam numeric FOREIGN KEY REFERENCES Team(id),
    idMember numeric FOREIGN KEY REFERENCES Member(id),
    role char CHECK (role IN ('C','P'))
);

CREATE TABLE Member(
    id integer PRIMARY KEY AUTOINCREMENT,
    email varchar,
);

CREATE TABLE TacticInfo(
    id integer PRIMARY KEY AUTOINCREMENT,
    name varchar,
    creation_date timestamp DEFAULT CURRENT_TIMESTAMP
);
