CREATE TABLE `bannertype` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL DEFAULT '',
    `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=utf8mb4;

insert into `bannertype` (id, name, active, created, createdById, updated, updatedById) VALUES
(1, 'App Home Screen Banners', 1, '2020-02-13 00:00:00', 10, '2020-02-13 00:00:00', 10);

CREATE TABLE `banner` (
    `id` int unsigned NOT NULL AUTO_INCREMENT,
    `shortDescription` varchar(255) NOT NULL DEFAULT '',
    `imageAssetId` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
    `link` varchar(255) NOT NULL DEFAULT '',
    `sequence` int NOT NULL DEFAULT '0',
    `firebaseDocumentId` varchar(255) NOT NULL DEFAULT '',
    `bannerTypeId` int unsigned NOT 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 `imageAssetId` (`imageAssetId`) USING BTREE,
    KEY `link` (`link`) USING BTREE,
    KEY `sequence` (`sequence`) USING BTREE,
    KEY `firebaseDocumentId` (`firebaseDocumentId`) USING BTREE,
    KEY `bannerTypeId` (`bannerTypeId`) USING BTREE,
    KEY `createdById` (`createdById`) USING BTREE,
    KEY `updatedById` (`updatedById`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4;
