create table `likes` (
`post_id` int,
`user_id` int,
foreign key (`post_id`) references `posts`(`id`) on delete cascade,
foreign key (`user_id`) references `users`(`id`) on delete cascade,
primary key (`post_id`, `user_id`)
) engine=InnoDB, default character set = utf8;
-- insert into`likes`(`post_id`, `user_id`) values (1, 1); постановка
-- delete from `likes` where `post_id` = 1 and `user_id` = 1; снятие
create table `likes` (
`post_id` int,
foreign key (`post_id`) references `posts`(`id`) on delete cascade,
foreign key (`user_id`) references `users`(`id`) on delete cascade,
primary key (`post_id`, `user_id`)
) engine=InnoDB, default character set = utf8;
(?:\w\.\w{1,8}|\w{2}\.\w{1,7}|...|\w{8}\.\w)