create table user (
id int not null primary key auto_increment,
name varchar(255) not null,
email varchar(255) not null,
);
create table follow (
id int not null primary key auto_increment,
followerId int not null,
followingId int not null,
foreign key (followerId) references user (id),
foreign key (followingId) references user (id)
);
create table content (
id int not null primary key auto_increment,
picture varchar(255) not null,
body varchar(255) not null,
created_at timestamp not null default current_timestamp,
userId int not null,
foreign key (userId) references user (id)
);
create table comment (
id int not null primary key auto_increment,
body varchar(255) not null,
contentId int not null,
userId int not null,
foreign key (contentId) references content (id),
foreign key (userId) references user (id)
);
create table like (
id int not null primary key auto_increment,
contentId int not null,
userId int not null,
foreign key (contentId) references content (id),
foreign key (userId) references user (id)
);
create table hashtag (
id int not null primary key auto_increment,
body varchar(255) not null,
);
create table content_hashtag (
id int not null primary key auto_increment,
contentId int not null,
hashtagId int not null,
foreign key (contentId) references content (id),
foreign key (hashtagId) references hashtag (id)
);
ERD: Entitiy Relationship Diagram