schema-sqlite.sql 843 B

123456789101112131415161718192021222324252627282930
  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 PRIMARY KEY AUTOINCREMENT NOT NULL,
  15. `category` varchar(255),
  16. `message` text
  17. );
  18. CREATE TABLE `message`
  19. (
  20. `id` integer NOT NULL REFERENCES `source_message` (`id`) ON UPDATE CASCADE ON DELETE NO ACTION,
  21. `language` varchar(16) NOT NULL,
  22. `translation` text,
  23. PRIMARY KEY (`id`, `language`)
  24. );
  25. CREATE INDEX idx_message_language ON message (language);
  26. CREATE INDEX idx_source_message_category ON source_message (category);