You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
986B

  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 IDENTITY 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 NO ACTION;
  26. CREATE INDEX [idx_message_language] on [message] ([language]);
  27. CREATE INDEX [idx_source_message_category] on [source_message] ([category]);