您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

34 行
990B

  1. /**
  2. * Database schema required by \yii\i18n\DbMessageSource.
  3. *
  4. * @author Dmitry Naumenko <d.naumenko.a@gmail.com>
  5. * @link http://www.yiiframework.com/
  6. * @copyright 2008 Yii Software LLC
  7. * @license http://www.yiiframework.com/license/
  8. * @since 2.0.7
  9. */
  10. drop table if exists `source_message`;
  11. drop table if exists `message`;
  12. CREATE TABLE `source_message`
  13. (
  14. `id` integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
  15. `category` varchar(255),
  16. `message` text
  17. );
  18. CREATE TABLE `message`
  19. (
  20. `id` integer NOT NULL,
  21. `language` varchar(16) NOT NULL,
  22. `translation` text
  23. );
  24. ALTER TABLE `message` ADD CONSTRAINT `pk_message_id_language` PRIMARY KEY (`id`, `language`);
  25. ALTER TABLE `message` ADD CONSTRAINT `fk_message_source_message` FOREIGN KEY (`id`) REFERENCES `source_message` (`id`) ON UPDATE CASCADE ON DELETE RESTRICT;
  26. CREATE INDEX idx_message_language ON message (language);
  27. CREATE INDEX idx_source_message_category ON source_message (category);