text: -- schema.sql
  
  drop database if exists blog;
  
  create database blog;
  
  use blog;
  
  grant select, insert, update, delete on blog.* to 'blog-data'@'localhost' identified by 'blog-data';
  
  create table user (
      `id` int unsigned not null auto_increment,
      `email` varchar(50) not null,
      `passwd` varchar(50) not null,
      `admin` bool not null,
      `name` varchar(50) not null,
      `image` varchar(500) not null,
      `created_at` real not null,
      unique key `idx_email` (`email`),
      key `idx_created_at` (`created_at`),
      primary key (`id`)
  ) engine=innodb default charset=utf8;
  
  create table blog (
      `id` int unsigned not null auto_increment,
      `user_id` varchar(50) not null,
      `user_name` varchar(50) not null,
      `user_image` varchar(500) not null,
      `name` varchar(50) not null,
      `summary` varchar(200) not null,
      `content` mediumtext not null,
      `created_at` real not null,
      key `idx_created_at` (`created_at`),
      primary key (`id`)
  ) engine=innodb default charset=utf8;
  
  create table comment (
      `id` int unsigned not null auto_increment,
      `parent_id` int not null,
      `blog_id` varchar(50) not null,
      `user_id` varchar(50) not null,
      `user_name` varchar(50) not null,
      `user_image` varchar(500) not null,
      `content` mediumtext not null,
      `created_at` real not null,
      key `idx_created_at` (`created_at`),
      primary key (`id`)
  ) engine=innodb default charset=utf8;