schema-mssql.sql 867 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Database schema required by \yii\log\DbTarget.
  3. *
  4. * The indexes declared are not required. They are mainly used to improve the performance
  5. * of some queries about message levels and categories. Depending on your actual needs, you may
  6. * want to create additional indexes (e.g. index on `log_time`).
  7. *
  8. * @author Alexander Makarov <sam@rmcreative.ru>
  9. * @link http://www.yiiframework.com/
  10. * @copyright 2008 Yii Software LLC
  11. * @license http://www.yiiframework.com/license/
  12. * @since 2.0.1
  13. */
  14. if object_id('[log]', 'U') is not null
  15. drop table [log];
  16. create table [log]
  17. (
  18. [id] bigint IDENTITY PRIMARY KEY,
  19. [level] integer,
  20. [category] varchar(255),
  21. [log_time] float,
  22. [prefix] text,
  23. [message] text
  24. );
  25. create index [idx_log_level] on [log] ([level]);
  26. create index [idx_log_category] on [log] ([category]);