create table membre(
    id int auto_increment primary key,
    nom varchar(50) not null,
    prenom varchar(50) not null,
    email varchar(100) not null unique
);

create table projet(
    id int auto_increment primary key,
    nom varchar(50) not null,
    commentaire text,
    date_lancement date,
    date_cloture date,
    statut varchar(20) not null
);

create table contribution(
    id int auto_increment primary key,
    membre_id int not null references membre(id),
    projet_id int not null references projet(id),
    date_contribution date not null,
    commentaire text,
    duree int default 0
);

create table assistant_ia(
    id int auto_increment primary key,
    nom varchar(50) not null
);

create table contrib_ia(
    id int auto_increment primary key,
    assistant_ia_id int not null references assistant_ia(id),
    contribution_id int not null references contribution(id),
    evaluation_pertinence int check (evaluation_pertinence >= 1 and evaluation_pertinence <= 5),
    evaluation_temps int check (evaluation_temps >= 1 and evaluation_temps <= 5),
    commentaire text
);


