Files
ave-cms/adminx/modules/Templates/migrations/002_create_template_revisions.sql
2026-07-27 12:58:44 +03:00

18 lines
800 B
SQL

CREATE TABLE IF NOT EXISTS `{{prefix}}_template_revisions` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`template_id` SMALLINT(3) UNSIGNED NOT NULL DEFAULT 0,
`action` VARCHAR(32) NOT NULL DEFAULT 'update',
`snapshot_hash` CHAR(40) NOT NULL DEFAULT '',
`text_hash` CHAR(40) NOT NULL DEFAULT '',
`snapshot_json` LONGTEXT NOT NULL,
`comment` VARCHAR(255) NOT NULL DEFAULT '',
`author_id` INT(10) UNSIGNED NOT NULL DEFAULT 0,
`author_name` VARCHAR(255) NOT NULL DEFAULT '',
`source_revision_id` INT(10) UNSIGNED NOT NULL DEFAULT 0,
`created_at` INT(10) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `idx_template_created` (`template_id`, `created_at`),
KEY `idx_action` (`action`),
KEY `idx_snapshot_hash` (`snapshot_hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;