CREATE TABLE `tierlevelrules` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `code` varchar(255) NOT NULL DEFAULT '',
    `name` varchar(255) NOT NULL DEFAULT '',
    `data` json NULL DEFAULT NULL,
    `active` tinyint(1) NOT NULL DEFAULT '1',
    `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
    `createdById` int unsigned NOT NULL DEFAULT '0',
    `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `updatedById` int unsigned NOT NULL DEFAULT '0',
    PRIMARY KEY (`id`),
    KEY `createdById` (`createdById`),
    KEY `updatedById` (`updatedById`),
    KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;

insert into `tierlevelrules` (id, code, name, data, active, created, createdById, updated, updatedById) VALUES
(1, 'buy_get_rule', 'Buy X Get Y For Free', NULL, 1, '2020-02-13 00:00:00', 10, '2020-02-13 00:00:00', 10);
