# QFQ tables: Filename has to start with 'qfq' and end with '.sql'
#
# Used to save tablesorter.js column selection settings. Free to use for other settings as well.
CREATE TABLE IF NOT EXISTS `Setting`
(
    `id`       INT(11)                 NOT NULL AUTO_INCREMENT,
    `type`     ENUM ('','tablesorter','notification','notification-popup','email','credentials','emailSyncCmd') NOT NULL DEFAULT '',
    `readonly` ENUM ('yes','no')       NOT NULL DEFAULT 'no' COMMENT 'Settings can''t be modified.',
    `name`     VARCHAR(64)             NOT NULL DEFAULT '',
    `name2`    VARCHAR(64)             NOT NULL DEFAULT '',
    `public`   TINYINT(1)              NOT NULL DEFAULT 0,
    `feUser`   VARCHAR(32)             NOT NULL DEFAULT '' COMMENT 'In case there is no logged in user, take QFQ cookie.',
    `tableId`  VARCHAR(64)             NOT NULL DEFAULT '',
    `view`     TEXT                    NOT NULL DEFAULT '',
    `modified` DATETIME                NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
    `created`  DATETIME                NOT NULL DEFAULT current_timestamp(),
    PRIMARY KEY (`id`),
    KEY `name` (`name`),
    KEY `typeFeUserUidTableIdPublic` (`type`, `feUser`, `tableId`, `public`) USING BTREE
)
    ENGINE = InnoDB
    DEFAULT CHARSET = utf8mb4
    AUTO_INCREMENT = 0;
