17 lines
751 B
SQL
17 lines
751 B
SQL
CREATE TABLE IF NOT EXISTS `#__testquestions_categories` (
|
|
`id` int unsigned NOT NULL AUTO_INCREMENT,
|
|
`title` varchar(150) NOT NULL,
|
|
`published` tinyint NOT NULL DEFAULT 1,
|
|
`ordering` int NOT NULL DEFAULT 0,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `idx_title` (`title`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
|
|
|
|
INSERT IGNORE INTO `#__testquestions_categories` (`id`, `title`, `published`, `ordering`)
|
|
VALUES (1, 'Bez kategorii', 1, 0);
|
|
|
|
ALTER TABLE `#__testquestions_questions`
|
|
ADD COLUMN `category_id` int unsigned NOT NULL DEFAULT 1 AFTER `id`,
|
|
ADD COLUMN `time_limit` smallint unsigned NOT NULL DEFAULT 60 AFTER `category_id`,
|
|
ADD COLUMN `points` tinyint unsigned NOT NULL DEFAULT 1 AFTER `time_limit`;
|