SQL File

SQL file for "Advanced Advertisements System" script

Copy the following code and run the query in your phpMyAdmin/HeidiSQL/...:

CREATE TABLE IF NOT EXISTS `uniq_advertisements` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `poster` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
  `category` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
  `data` LONGTEXT NULL DEFAULT '{}' COLLATE 'utf8mb3_general_ci',
  `datetime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `expiration_datetime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `uniq_advertisements_categories` (
  `name` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
  `label` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
  UNIQUE KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `uniq_advertisements_comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ad_id` int(11) NOT NULL,
  `poster` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
  `comment` LONGTEXT NULL DEFAULT '{}' COLLATE 'utf8mb3_general_ci',  
  `datetime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  UNIQUE KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Last updated