alter table class add image_id varchar(100);

alter table class add image_url varchar(150);

alter table users add image_id varchar(100);

alter table users add image_url varchar(150);

create table classwork_post(
    id int primary key auto_increment,
    class_id int not null,
    week int not null,
    title varchar(255),
    description text,
    post_type varchar(50),
    upload_type varchar(50),
    is_due_date varchar(1),
    file_id varchar(100),
    start_date TIMESTAMP,
    end_date TIMESTAMP,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

create table classwork_submission(
    id int primary key auto_increment,
    class_id int not null,
    user_id int not null,
    post_id int not null,
    text text,
    file_id varchar(100),
    score int,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

create table classwork_comment(
    id int primary key auto_increment,
    user_id int,
    post_id int,
    comment text,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

create table files(
    file_id varchar(100) primary key,
    file_name varchar(255),
    file_url varchar(255),
    file_thumbnail varchar(255),
    file_mimetype varchar(20),
    file_size varchar(150),
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)

ALTER TABLE class CHANGE username user_id int;

create table classwork_comment_report(
    id int primary key auto_increment,
  	report_id int not null,
    comment_id int not null,
    report text,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
