<?php

// an array of tables that are created.

// we need this so if the addon is uninstalled, we know what we need to clean up.

$tables = array('feedbackloop_mails', 'feedbackloop');



// the actual queries we're going to run.

$queries = array();

$queries[] = 'DROP TABLE IF EXISTS %%TABLEPREFIX%%feedbackloop_mails';

$queries[] = 'CREATE TABLE IF NOT EXISTS %%TABLEPREFIX%%feedbackloop_mails (

  `uid` int(11) NOT NULL AUTO_INCREMENT,

  `recipient` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  `mail_date` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  `sender_address_domain` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  `recipient_id` int(11) NOT NULL,

  `recipient_ip` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  `recipient_domain` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  `list_id` int(11) NOT NULL,

  `stat_id` int(11) NOT NULL,

  `interspire_domain` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  PRIMARY KEY (`uid`)

) ENGINE=MyISAM';

$queries[]='CREATE TABLE IF NOT EXISTS %%TABLEPREFIX%%feedbackloop (

  `uid` int(11) NOT NULL AUTO_INCREMENT,

  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  `hostname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  `type` int(11) NOT NULL DEFAULT "1",

  `method` int(11) NOT NULL DEFAULT "1",

  `port` int(11) NOT NULL,

  `advanced` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  PRIMARY KEY (`uid`)

) ENGINE = MYISAM';