database.sql 545 B

12345678910111213141516171819202122
  1. create table article
  2. (
  3. id int auto_increment
  4. primary key,
  5. title varchar(120) not null,
  6. createtime datetime not null,
  7. author_id int not null,
  8. constraint article_auth_user_id_fk
  9. foreign key (author_id) references auth_user (id)
  10. );
  11. create table content
  12. (
  13. id int not null
  14. primary key,
  15. content text null,
  16. constraint content_article_id_fk
  17. foreign key (id) references article (id)
  18. );
  19. CREATE DATABASE `cm_blog` /*!40100 DEFAULT CHARACTER SET utf8mb4 */