--- /dev/null
+-- Gaslight Media Members Database - Coupons Add-On
+-- File Created: 11/15/16
+-- Database Version: 0.0.1
+-- Database Creation Script
+--
+-- This file is called to create a new set of tables for this
+-- add-on for the most recent database version for this add-on.
+--
+-- There should only be one such file in this directory
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+
+
+-- Coupons
+CREATE TABLE {prefix}coupons (
+ id INT NOT NULL AUTO_INCREMENT,
+ status INT NULL, -- Status of the Coupon (Active Pending)
+ created DATETIME NULL, -- Create date
+ updated DATETIME NULL, -- Update date
+ approved DATETIME NULL, -- Approved date
+ start_date DATE NULL, -- Starting date of the coupon
+ end_date DATE NULL, -- Ending date of the coupon
+ expire DATE NULL, -- Expire date of the coupon
+ name TINYTEXT NULL, -- Coupon name
+ name_slug TINYTEXT NULL, -- Coupon name slug
+ ref_type INT NULL, -- Ref type
+ ref_dest INT NULL, -- Id from ref type table
+ descr TEXT NULL, -- Description of the coupon
+ image TINYTEXT NULL, -- Coupon image
+ url TINYTEXT NULL, -- website of the coupon
+ PRIMARY KEY(id),
+ INDEX(ref_type),
+ INDEX(ref_dest),
+ INDEX(start_date),
+ INDEX(end_date)
+);
+
+----
+
+-- Categories
+CREATE TABLE {prefix}categories (
+ id INT NOT NULL AUTO_INCREMENT,
+ name TINYTEXT NULL, -- Category Name
+ PRIMARY KEY (id),
+ INDEX(name(20))
+);
+
+----
+
+-- Settings
+CREATE TABLE {prefix}settings (
+ id INT NOT NULL AUTO_INCREMENT,
+ notify_to TINYTEXT NULL, -- To for the notify email
+ notify_from TINYTEXT NULL, -- From header for notify email
+ notify_message TEXT NULL, -- Message to add to the notify email
+ PRIMARY KEY (id)
+);
+
+----
+
+-- Data for Settings
+INSERT INTO {prefix}settings
+(id,notify_to,notify_from,notify_message)
+VALUES
+(1, '', '', '');
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * GLM Members Coupons DB Versions
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release dbVersions.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link http://dev.gaslightmedia.com/
+ */
+
+$glmMembersCouponsDbVersions = array(
+ '0.0.1' => array('version' => '0.0.1', 'tables' => 3),
+);
+