X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=install%2Ftables.sql;h=31d2797d1305465ced4677ec6031e784c7024373;hp=24c48bbe9f056a7634e05dce698cbae14db88d54;hb=a7c7b8307405aa270a38ce4e363c41b3d1c9c745;hpb=213f1d91fb640b61be217a3104c8588404f096a8 diff --git a/install/tables.sql b/install/tables.sql index 24c48bbe9f..31d2797d13 100644 --- a/install/tables.sql +++ b/install/tables.sql @@ -1,346 +1,241 @@ -DROP TABLE IF EXISTS `mxchange_admin_menu`; -CREATE TABLE `mxchange_admin_menu` ( - `id` bigint(22) NOT NULL auto_increment, - `action` varchar(255) NOT NULL default '', - `what` varchar(255) NOT NULL default '', - `title` varchar(50) NOT NULL default '', - `sort` bigint(20) NOT NULL default '0', - `descr` blob NOT NULL, - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_admins`; -CREATE TABLE `mxchange_admins` ( - `id` bigint(20) NOT NULL auto_increment, - `login` varchar(100) NOT NULL default '', - `password` varchar(40) NOT NULL default '', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_cats`; -CREATE TABLE `mxchange_cats` ( - `id` bigint(22) NOT NULL auto_increment, - `cat` varchar(255) NOT NULL default '', - `visible` enum('Y','N') NOT NULL default 'Y', - `sort` bigint(20) NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_config`; -CREATE TABLE `mxchange_config` ( - `config` tinyint(1) NOT NULL default '0', - `pass_len` tinyint(4) NOT NULL default '5', - `points_register` bigint(20) NOT NULL default '0', - `points_ref` bigint(20) NOT NULL default '0', - `least_cats` tinyint(4) NOT NULL default '5', - `check_double_email` enum('Y','N') NOT NULL default 'Y', - `check_double_pass` enum('Y','N') NOT NULL default 'N', - `admin_notify` enum('Y','N') NOT NULL default 'Y', - `url_tlock` bigint(20) NOT NULL default '86400', - `test_text` enum('Y','N') NOT NULL default 'Y', - `max_tlength` bigint(20) NOT NULL default '1000', - `test_subj` enum('Y','N') NOT NULL default 'Y', - `autosend_active` enum('Y','N') NOT NULL default 'N', - PRIMARY KEY (`config`) -) TYPE=MyISAM; - -INSERT INTO `mxchange_config` VALUES (0,5,2000,200,5,'Y','N','Y',86400,'Y',1000,'Y','N'); - -DROP TABLE IF EXISTS `mxchange_guest_menu`; -CREATE TABLE `mxchange_guest_menu` ( - `id` bigint(22) NOT NULL auto_increment, - `action` varchar(20) NOT NULL default '', - `what` varchar(20) NOT NULL default '', - `title` varchar(50) NOT NULL default '', - `sort` bigint(20) NOT NULL default '0', - `visible` enum('Y','N') NOT NULL default 'Y', - `locked` enum('Y','N') NOT NULL default 'Y', - `counter` bigint(20) NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_max_receive`; -CREATE TABLE `mxchange_max_receive` ( - `id` bigint(22) NOT NULL auto_increment, - `value` mediumint(9) NOT NULL default '0', - `comment` varchar(255) NOT NULL default '', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_member_menu`; -CREATE TABLE `mxchange_member_menu` ( - `id` bigint(22) NOT NULL auto_increment, - `action` varchar(20) NOT NULL default '', - `what` varchar(20) NOT NULL default '', - `title` varchar(50) NOT NULL default '', - `sort` bigint(20) NOT NULL default '0', - `visible` enum('Y','N') NOT NULL default 'Y', - `locked` enum('Y','N') NOT NULL default 'Y', - `descr` blob NOT NULL, - `counter` bigint(20) NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_mod_reg`; -CREATE TABLE `mxchange_mod_reg` ( - `id` bigint(20) NOT NULL auto_increment, - `module` varchar(50) NOT NULL default '', - `locked` enum('Y','N') NOT NULL default 'Y', - `hidden` enum('Y','N') NOT NULL default 'N', - `admin_only` enum('Y','N') NOT NULL default 'N', - `title` varchar(200) NOT NULL default '', - `mem_only` enum('Y','N') NOT NULL default 'N', - `clicks` bigint(20) NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -INSERT INTO `mxchange_mod_reg` VALUES (1,'admin','N','N','Y','','N',0); -INSERT INTO `mxchange_mod_reg` VALUES (2,'index','N','N','N','','N',0); -INSERT INTO `mxchange_mod_reg` VALUES (3,'frameset','Y','N','N','','N',0); -INSERT INTO `mxchange_mod_reg` VALUES (4,'login','N','N','N','','Y',0); -INSERT INTO `mxchange_mod_reg` VALUES (6,'frametester','N','Y','N','','N',0); -INSERT INTO `mxchange_mod_reg` VALUES (7,'loader','N','Y','N','','N',0); -INSERT INTO `mxchange_mod_reg` VALUES (8,'order','N','N','N','','N',0); - -DROP TABLE IF EXISTS `mxchange_payments`; -CREATE TABLE `mxchange_payments` ( - `id` bigint(20) NOT NULL auto_increment, - `time` int(11) NOT NULL default '0', - `payment` float(5,3) NOT NULL default '0.000', - `mail_title` varchar(255) NOT NULL default '', - `price` float(5,3) NOT NULL default '0.000', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_pool`; -CREATE TABLE `mxchange_pool` ( - `id` bigint(20) NOT NULL auto_increment, - `sender` bigint(20) NOT NULL default '0', - `subject` varchar(200) NOT NULL default '', - `text` longblob NOT NULL, - `receivers` longblob NOT NULL, - `payment_id` tinyint(4) NOT NULL default '0', - `data_type` enum('TEMP','SEND','NEW','ADMIN') NOT NULL default 'TEMP', - `timestamp` varchar(10) NOT NULL default '0', - `url` tinytext NOT NULL, - `target_send` bigint(20) NOT NULL default '0', - `cat_id` bigint(20) NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_refbanner`; -CREATE TABLE `mxchange_refbanner` ( - `id` bigint(22) NOT NULL auto_increment, - `url` text NOT NULL, - `alternate` text NOT NULL, - `visible` enum('Y','N') NOT NULL default 'Y', - `counter` bigint(22) NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_refdepths`; -CREATE TABLE `mxchange_refdepths` ( - `id` tinyint(4) NOT NULL auto_increment, - `level` tinyint(4) NOT NULL default '0', - `percents` tinyint(4) NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -INSERT INTO `mxchange_refdepths` VALUES (1,0,100); -INSERT INTO `mxchange_refdepths` VALUES (2,1,30); -INSERT INTO `mxchange_refdepths` VALUES (3,2,15); -INSERT INTO `mxchange_refdepths` VALUES (4,3,10); -INSERT INTO `mxchange_refdepths` VALUES (5,4,8); -INSERT INTO `mxchange_refdepths` VALUES (6,5,5); - -DROP TABLE IF EXISTS `mxchange_refsystem`; -CREATE TABLE `mxchange_refsystem` ( - `id` bigint(22) NOT NULL auto_increment, - `userid` bigint(20) NOT NULL default '0', - `level` tinyint(4) NOT NULL default '0', - `counter` bigint(20) NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_user_cats`; -CREATE TABLE `mxchange_user_cats` ( - `id` bigint(22) NOT NULL auto_increment, - `userid` bigint(20) NOT NULL default '0', - `cat_id` tinyint(4) NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_user_data`; -CREATE TABLE `mxchange_user_data` ( - `userid` bigint(22) NOT NULL auto_increment, - `surname` varchar(255) NOT NULL default '', - `family` varchar(255) NOT NULL default '', - `street_nr` varchar(255) NOT NULL default '', - `country` varchar(4) NOT NULL default '', - `zip` varchar(6) NOT NULL default '', - `city` varchar(255) NOT NULL default '', - `email` varchar(255) NOT NULL default '', - `birth_day` char(2) NOT NULL default '01', - `birth_month` char(2) NOT NULL default '01', - `birth_year` varchar(4) NOT NULL default '1970', - `password` varchar(32) NOT NULL default '', - `max_mails` int(11) NOT NULL default '0', - `receive_mails` int(11) NOT NULL default '0', - `refid` bigint(22) NOT NULL default '0', - `status` enum('UNCONFIRMED','CONFIRMED','LOCKED') NOT NULL default 'UNCONFIRMED', - `user_hash` varchar(32) NOT NULL default '', - `REMOTE_ADDR` varchar(15) NOT NULL default '0.0.0.0', - `last_online` varchar(10) NOT NULL default '0', - `last_module` varchar(20) NOT NULL default '', - `ref_clicks` bigint(20) NOT NULL default '0', - `total_logins` bigint(20) NOT NULL default '0', - `sex` enum('M','F') NOT NULL default 'M', - `used_points` double(22,3) NOT NULL default '0.000', - `emails_sent` bigint(20) NOT NULL default '0', - PRIMARY KEY (`userid`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_user_points`; -CREATE TABLE `mxchange_user_points` ( - `id` bigint(22) NOT NULL auto_increment, - `userid` bigint(22) NOT NULL default '0', - `ref_depth` tinyint(4) NOT NULL default '0', - `points` double(22,3) NOT NULL default '0.000', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -alter table `mxchange_config` add `max_send` tinyint not null default '100'; -alter table `mxchange_config` add `url_blacklist` enum('Y','N') not null default 'Y'; -alter table `mxchange_config` add `auto_purge` tinyint not null default '14'; -alter table `mxchange_config` add `auto_purge_active` enum('Y','N') not null default 'Y'; - -alter table `mxchange_pool` modify `url` tinytext not null; -alter table `mxchange_pool` change `url` `url` tinyblob not null; -alter table `mxchange_pool` modify `data_type` enum('TEMP','SEND','NEW','ADMIN','ACTIVE') not null default 'TEMP'; - -DROP TABLE IF EXISTS `mxchange_user_links`; -CREATE TABLE `mxchange_user_links` ( - `id` bigint(20) NOT NULL auto_increment, - `stats_id` bigint(20) NOT NULL default '0', - `userid` bigint(20) NOT NULL default '0', - `link_type` enum('NORMAL') NOT NULL default 'NORMAL', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_user_stats`; -CREATE TABLE `mxchange_user_stats` ( - `id` bigint(20) NOT NULL auto_increment, - `userid` bigint(20) NOT NULL default '0', - `cat_id` bigint(20) NOT NULL default '0', - `payment_id` bigint(20) NOT NULL default '0', - `subject` varchar(200) NOT NULL default '', - `url` tinyblob NOT NULL, - `max_rec` bigint(20) NOT NULL default '0', - `timestamp_ordered` varchar(10) NOT NULL default '', - `pool_id` bigint(20) NOT NULL default '0', - `timestamp_sstart` varchar(10) NOT NULL default '', - `timestamp_send` varchar(10) NOT NULL default '', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -alter table `mxchange_user_data` add `joined` varchar(10) not null default '0'; -alter table `mxchange_config` add `last_update` varchar(10) not null default '0'; - -UPDATE `mxchange_member_menu` SET `locked` = 'N' WHERE 'id'='12' OR 'id'='11' LIMIT 1; - -UPDATE `mxchange_guest_menu` SET `counter`=0; -UPDATE `mxchange_member_menu` SET `counter`=0; - -INSERT INTO `mxchange_mod_reg` VALUES (NULL,'chk_login','N','N','N','','N',0); -alter table `mxchange_pool` modify `data_type` enum('TEMP','SEND','NEW','ADMIN','ACTIVE') not null default 'TEMP'; -alter table `mxchange_config` add `unconfirmed` bigint not null default '100'; -alter table `mxchange_config` add `profile_lock` bigint not null default '86400'; -alter table `mxchange_user_data` add `last_update` varchar(10) not null default '0'; -alter table `mxchange_refbanner` add `clicks` bigint not null default '0'; -alter table `mxchange_config` add `online_timeout` bigint not null default '1800'; - -alter table `mxchange_config` add `mad_timestamp` varchar(10) not null default '0'; -alter table `mxchange_config` add `mad_count` bigint not null; -alter table `mxchange_config` add `profile_update` bigint not null default '15768000'; -alter table `mxchange_config` add `send_prof_update` enum('Y','N') not null default 'Y'; -alter table `mxchange_config` add `resend_profile_update` bigint not null default '172800'; - -alter table `mxchange_user_data` add `last_profile_sent` varchar(10) not null default '0'; -alter table `mxchange_user_data` add `notified` enum('Y','N') not null default 'N'; - -alter table `mxchange_config` add `patch_level` varchar(100) not null default '78'; -alter table `mxchange_config` add `patch_ctime` varchar(10) not null default '0'; - -alter table `mxchange_admins` add `email` varchar(255) not null; - -DROP TABLE IF EXISTS `mxchange_task_system`; -CREATE TABLE `mxchange_task_system` ( - `id` bigint(20) NOT NULL auto_increment, - `assigned_admin` bigint(20) NOT NULL default '0', - `userid` bigint(20) NOT NULL default '0', - `status` enum('NEW','OPEN','SOLVED','CLOSED','DELETED') NOT NULL default 'NEW', - `task_type` enum('FIRST_USER','SUPPORT_MEMBER','SUPPORT_ADMIN','OTHERS', 'EXTENSION', 'EXTENSION_UPDATE') NOT NULL default 'FIRST_USER', - `subject` varchar(255) NOT NULL default '', - `text` longblob NOT NULL, - `task_created` varchar(10) NOT NULL default '0', - KEY (`assigned_admin`), - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -ALTER TABLE `mxchange_pool` ADD INDEX (`sender`); -ALTER TABLE `mxchange_pool` ADD INDEX (`payment_id`); -ALTER TABLE `mxchange_pool` ADD INDEX (`cat_id`); -ALTER TABLE `mxchange_refsystem` ADD INDEX (`userid`); -ALTER TABLE `mxchange_task_system` ADD INDEX (`assigned_admin`); -ALTER TABLE `mxchange_task_system` ADD INDEX (`userid`); -ALTER TABLE `mxchange_user_cats` ADD INDEX (`userid`); -ALTER TABLE `mxchange_user_cats` ADD INDEX (`cat_id`); -ALTER TABLE `mxchange_user_data` ADD INDEX (`refid`); -ALTER TABLE `mxchange_user_links` ADD INDEX (`userid`); -ALTER TABLE `mxchange_user_links` ADD INDEX (`stats_id`); -ALTER TABLE `mxchange_user_points` ADD INDEX (`userid`); -ALTER TABLE `mxchange_user_stats` ADD INDEX (`userid`); -ALTER TABLE `mxchange_user_stats` ADD INDEX (`cat_id`); -ALTER TABLE `mxchange_user_stats` ADD INDEX (`payment_id`); -ALTER TABLE `mxchange_user_stats` ADD INDEX (`pool_id`); - -alter table `mxchange_user_stats` add `clicks` bigint not null; -alter table `mxchange_config` add `code_length` tinyint not null default '5'; -alter table `mxchange_config` add `guest_stats` enum('MEMBERS','MODULES','INACTIVE') not null default 'MEMBERS'; -alter table `mxchange_config` add `ref_payout` tinyint not null default '5'; -alter table `mxchange_user_data` add `ref_payout` tinyint not null default '0'; -alter table `mxchange_user_points` add `locked_points` bigint not null default '0'; - -DROP TABLE IF EXISTS `mxchange_extensions`; -CREATE TABLE `mxchange_extensions` ( - `id` bigint(20) NOT NULL auto_increment, - `ext_name` varchar(255) NOT NULL default '', - `ext_lang_file` varchar(255) NOT NULL default '', - `ext_active` enum('Y','N') NOT NULL default 'N', - `ext_version` varchar(255) NOT NULL default '0.', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -DROP TABLE IF EXISTS `mxchange_jackpot`; -CREATE TABLE `mxchange_jackpot` ( - `ok` char(2) NOT NULL default 'ok', - `points` double(23,3) NOT NULL default '0.000', - PRIMARY KEY (`ok`) -) TYPE=MyISAM; - -alter table `mxchange_config` add `activate_xchange` bigint(20) not null default '100'; -alter table `mxchange_config` add `order_multi_page` enum('Y','N') not null default 'Y'; -alter table `mxchange_config` add `display_refid` enum('Y','N') not null default 'Y'; -alter table `mxchange_config` add `ip_timeout` bigint(20) not null default '86400'; -alter table `mxchange_pool` add `zip` varchar(6) not null default ''; - -alter table `mxchange_task_system` change `task_type` `task_type` varchar(255) not null default 'FIRST_USER'; -alter table `mxchange_user_data` modify `zip` varchar(6) not null default ''; -alter table `mxchange_admin_menu` modify `action` varchar(255) not null default ''; -alter table `mxchange_admin_menu` modify `what` varchar(255) not null default ''; -alter table `mxchange_user_data` modify `last_module` varchar(255) not null default ''; -alter table `mxchange_config` add `allow_direct_pay` enum('N', 'Y') not null default 'N'; -alter table `mxchange_user_data` modify `last_profile_sent` varchar(10) not null default '0'; -alter table `mxchange_user_data` modify `last_update` varchar(10) not null default '0'; -alter table `mxchange_user_data` modify `joined` varchar(10) not null default '0'; -alter table `mxchange_user_data` modify `last_online` varchar(10) not null default '0'; +DROP TABLE IF EXISTS `{!prefix!}_admin_menu`; +CREATE TABLE `{!prefix!}_admin_menu` ( + `id` BIGINT(22) NOT NULL AUTO_INCREMENT, + `action` VARCHAR(255) NOT NULL DEFAULT '', + `what` VARCHAR(255) NULL DEFAULT NULL, + `title` VARCHAR(50) NOT NULL DEFAULT '', + `sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + `descr` TEXT NOT NULL, + PRIMARY KEY (`id`) +) TYPE={!type!}; + +DROP TABLE IF EXISTS `{!prefix!}_admins`; +CREATE TABLE `{!prefix!}_admins` ( + `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `login` VARCHAR(100) NOT NULL DEFAULT '', + `password` VARCHAR(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) TYPE={!type!}; + +DROP TABLE IF EXISTS `{!prefix!}_cats`; +CREATE TABLE `{!prefix!}_cats` ( + `id` BIGINT(22) NOT NULL AUTO_INCREMENT, + `cat` VARCHAR(255) NOT NULL DEFAULT '', + `visible` ENUM('Y','N') NOT NULL DEFAULT 'Y', + `sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) TYPE={!type!}; + +DROP TABLE IF EXISTS `{!prefix!}_config`; +CREATE TABLE `{!prefix!}_config` ( + `config` tinyint(1) NOT NULL DEFAULT 0, + `pass_len` TINYINT(3) UNSIGNED NOT NULL DEFAULT 5, + `points_register` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + `points_ref` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + `least_cats` TINYINT(3) UNSIGNED NOT NULL DEFAULT 5, + `check_double_email` ENUM('Y','N') NOT NULL DEFAULT 'Y', + `check_double_pass` ENUM('Y','N') NOT NULL DEFAULT 'N', + `admin_notify` ENUM('Y','N') NOT NULL DEFAULT 'Y', + `url_tlock` BIGINT(20) UNSIGNED NOT NULL DEFAULT '86400', + `test_text` ENUM('Y','N') NOT NULL DEFAULT 'Y', + `max_tlength` BIGINT(20) UNSIGNED NOT NULL DEFAULT '1000', + `test_subj` ENUM('Y','N') NOT NULL DEFAULT 'Y', + `autosend_active` ENUM('Y','N') NOT NULL DEFAULT 'N', + PRIMARY KEY (`config`) +) TYPE={!type!}; + +INSERT INTO `{!prefix!}_config` VALUES (0,5,2000,200,5,'Y','N','Y',86400,'Y',1000,'Y','N'); + +DROP TABLE IF EXISTS `{!prefix!}_guest_menu`; +CREATE TABLE `{!prefix!}_guest_menu` ( + `id` BIGINT(22) NOT NULL AUTO_INCREMENT, + `action` VARCHAR(255) NOT NULL DEFAULT '', + `what` VARCHAR(255) NULL DEFAULT NULL, + `title` VARCHAR(50) NOT NULL DEFAULT '', + `sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + `visible` ENUM('Y','N') NOT NULL DEFAULT 'Y', + `locked` ENUM('Y','N') NOT NULL DEFAULT 'Y', + `counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) TYPE={!type!}; + +DROP TABLE IF EXISTS `{!prefix!}_max_receive`; +CREATE TABLE `{!prefix!}_max_receive` ( + `id` BIGINT(22) NOT NULL AUTO_INCREMENT, + `value` MEDIUMINT(9) NOT NULL DEFAULT 0, + `comment` VARCHAR(255) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) TYPE={!type!}; + +DROP TABLE IF EXISTS `{!prefix!}_member_menu`; +CREATE TABLE `{!prefix!}_member_menu` ( + `id` BIGINT(22) NOT NULL AUTO_INCREMENT, + `action` VARCHAR(255) NOT NULL DEFAULT '', + `what` VARCHAR(255) NULL DEFAULT NULL, + `title` VARCHAR(50) NOT NULL DEFAULT '', + `sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + `visible` ENUM('Y','N') NOT NULL DEFAULT 'Y', + `locked` ENUM('Y','N') NOT NULL DEFAULT 'Y', + `counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) TYPE={!type!}; + +DROP TABLE IF EXISTS `{!prefix!}_mod_reg`; +CREATE TABLE `{!prefix!}_mod_reg` ( + `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `module` VARCHAR(50) NOT NULL DEFAULT '', + `locked` ENUM('Y','N') NOT NULL DEFAULT 'Y', + `hidden` ENUM('Y','N') NOT NULL DEFAULT 'N', + `admin_only` ENUM('Y','N') NOT NULL DEFAULT 'N', + `title` VARCHAR(200) NOT NULL DEFAULT '', + `mem_only` ENUM('Y','N') NOT NULL DEFAULT 'N', + `clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) TYPE={!type!}; + +INSERT INTO `{!prefix!}_mod_reg` VALUES (1,'admin','N','N','Y','','N',0); +INSERT INTO `{!prefix!}_mod_reg` VALUES (2,'index','N','N','N','','N',0); +INSERT INTO `{!prefix!}_mod_reg` VALUES (3,'frameset','Y','N','N','','N',0); +INSERT INTO `{!prefix!}_mod_reg` VALUES (4,'login','N','N','N','','Y',0); +INSERT INTO `{!prefix!}_mod_reg` VALUES (6,'frametester','N','Y','N','','N',0); +INSERT INTO `{!prefix!}_mod_reg` VALUES (7,'loader','N','Y','N','','N',0); +INSERT INTO `{!prefix!}_mod_reg` VALUES (8,'order','N','N','N','','N',0); + +DROP TABLE IF EXISTS `{!prefix!}_payments`; +CREATE TABLE `{!prefix!}_payments` ( + `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `time` INT(7) NOT NULL DEFAULT 0, + `payment` FLOAT(5,3) UNSIGNED NOT NULL DEFAULT '0.000', + `mail_title` VARCHAR(255) NOT NULL DEFAULT '', + `price` FLOAT(5,5) UNSIGNED NOT NULL DEFAULT '0.00000', + PRIMARY KEY (`id`) +) TYPE={!type!}; + +DROP TABLE IF EXISTS `{!prefix!}_pool`; +CREATE TABLE `{!prefix!}_pool` ( + `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `sender` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + `subject` VARCHAR(200) NOT NULL DEFAULT '', + `text` LONGTEXT NOT NULL, + `receivers` LONGTEXT NOT NULL, + `payment_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0, + `data_type` ENUM('TEMP','SEND','NEW','ADMIN') NOT NULL DEFAULT 'TEMP', + `timestamp` VARCHAR(10) NOT NULL DEFAULT 0, + `url` TINYTEXT NOT NULL, + `target_send` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + `cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) TYPE={!type!}; + +DROP TABLE IF EXISTS `{!prefix!}_refbanner`; +CREATE TABLE `{!prefix!}_refbanner` ( + `id` BIGINT(22) NOT NULL AUTO_INCREMENT, + `url` TEXT NOT NULL, + `alternate` TEXT NOT NULL, + `visible` ENUM('Y','N') NOT NULL DEFAULT 'Y', + `counter` BIGINT(22) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) TYPE={!type!}; + +DROP TABLE IF EXISTS `{!prefix!}_refdepths`; +CREATE TABLE `{!prefix!}_refdepths` ( + `id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, + `level` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0, + `percents` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) TYPE={!type!}; + +INSERT INTO `{!prefix!}_refdepths` VALUES (1,0,100); +INSERT INTO `{!prefix!}_refdepths` VALUES (2,1,30); +INSERT INTO `{!prefix!}_refdepths` VALUES (3,2,15); +INSERT INTO `{!prefix!}_refdepths` VALUES (4,3,10); +INSERT INTO `{!prefix!}_refdepths` VALUES (5,4,8); +INSERT INTO `{!prefix!}_refdepths` VALUES (6,5,5); + +DROP TABLE IF EXISTS `{!prefix!}_refsystem`; +CREATE TABLE `{!prefix!}_refsystem` ( + `id` BIGINT(22) NOT NULL AUTO_INCREMENT, + `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + `level` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0, + `counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) TYPE={!type!}; + +ALTER TABLE `{!prefix!}_config` ADD `max_send` TINYINT(3) UNSIGNED NOT NULL DEFAULT '100'; +ALTER TABLE `{!prefix!}_config` ADD `url_blacklist` ENUM('Y','N') NOT NULL DEFAULT 'Y'; +ALTER TABLE `{!prefix!}_config` ADD `auto_purge` TINYINT(3) UNSIGNED NOT NULL DEFAULT '14'; +ALTER TABLE `{!prefix!}_config` ADD `auto_purge_active` ENUM('Y','N') NOT NULL DEFAULT 'Y'; + +ALTER TABLE `{!prefix!}_pool` MODIFY `url` TINYTEXT NOT NULL; +ALTER TABLE `{!prefix!}_pool` CHANGE `url` `url` TINYTEXT NOT NULL; +ALTER TABLE `{!prefix!}_pool` MODIFY `data_type` ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE') NOT NULL DEFAULT 'TEMP'; + +ALTER TABLE `{!prefix!}_config` ADD `last_update` VARCHAR(10) NOT NULL DEFAULT 0; + +INSERT INTO `{!prefix!}_mod_reg` VALUES (NULL,'chk_login','N','N','N','','N',0); +ALTER TABLE `{!prefix!}_pool` MODIFY `data_type` ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE') NOT NULL DEFAULT 'TEMP'; +ALTER TABLE `{!prefix!}_config` ADD `unconfirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT '100'; +ALTER TABLE `{!prefix!}_config` ADD `profile_lock` BIGINT(20) UNSIGNED NOT NULL DEFAULT '86400'; +ALTER TABLE `{!prefix!}_refbanner` ADD `clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `{!prefix!}_config` ADD `online_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT '1800'; + +ALTER TABLE `{!prefix!}_config` ADD `mad_timestamp` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `{!prefix!}_config` ADD `mad_count` BIGINT(20) UNSIGNED NOT NULL; +ALTER TABLE `{!prefix!}_config` ADD `profile_update` BIGINT(20) UNSIGNED NOT NULL DEFAULT '15768000'; +ALTER TABLE `{!prefix!}_config` ADD `send_prof_update` ENUM('Y','N') NOT NULL DEFAULT 'Y'; +ALTER TABLE `{!prefix!}_config` ADD `resend_profile_update` BIGINT(20) UNSIGNED NOT NULL DEFAULT '172800'; + +ALTER TABLE `{!prefix!}_config` ADD `patch_level` VARCHAR(100) NOT NULL DEFAULT '78'; +ALTER TABLE `{!prefix!}_config` ADD `patch_ctime` VARCHAR(10) NOT NULL DEFAULT 0; + +ALTER TABLE `{!prefix!}_admins` ADD `email` VARCHAR(255) NOT NULL; + +DROP TABLE IF EXISTS `{!prefix!}_task_system`; +CREATE TABLE `{!prefix!}_task_system` ( + `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `assigned_admin` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, + `status` ENUM('NEW','OPEN','SOLVED','CLOSED','DELETED') NOT NULL DEFAULT 'NEW', + `task_type` ENUM('FIRST_USER','SUPPORT_MEMBER','SUPPORT_ADMIN','OTHERS','EXTENSION','EXTENSION_UPDATE') NOT NULL DEFAULT 'FIRST_USER', + `subject` VARCHAR(255) NOT NULL DEFAULT '', + `text` LONGTEXT NOT NULL, + `task_created` VARCHAR(10) NOT NULL DEFAULT 0, + KEY (`assigned_admin`), + PRIMARY KEY (`id`) +) TYPE={!type!}; + +ALTER TABLE `{!prefix!}_pool` ADD INDEX (`sender`); +ALTER TABLE `{!prefix!}_pool` ADD INDEX (`payment_id`); +ALTER TABLE `{!prefix!}_pool` ADD INDEX (`cat_id`); +ALTER TABLE `{!prefix!}_refsystem` ADD INDEX (`userid`); +ALTER TABLE `{!prefix!}_task_system` ADD INDEX (`assigned_admin`); +ALTER TABLE `{!prefix!}_task_system` ADD INDEX (`userid`); + +ALTER TABLE `{!prefix!}_config` ADD `code_length` TINYINT(3) UNSIGNED NOT NULL DEFAULT 5; +ALTER TABLE `{!prefix!}_config` ADD `guest_stats` ENUM('MEMBERS','MODULES','INACTIVE') NOT NULL DEFAULT 'MEMBERS'; +ALTER TABLE `{!prefix!}_config` ADD `ref_payout` TINYINT(3) UNSIGNED NOT NULL DEFAULT 5; + +DROP TABLE IF EXISTS `{!prefix!}_extensions`; +CREATE TABLE `{!prefix!}_extensions` ( + `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `ext_name` VARCHAR(255) NOT NULL DEFAULT '', + `ext_active` ENUM('Y','N') NOT NULL DEFAULT 'N', + `ext_version` VARCHAR(255) NOT NULL DEFAULT 'INVALID', + PRIMARY KEY (`id`) +) TYPE={!type!}; + +DROP TABLE IF EXISTS `{!prefix!}_jackpot`; +CREATE TABLE `{!prefix!}_jackpot` ( + `ok` CHAR(2) NOT NULL DEFAULT 'ok', + `points` FLOAT(20,3) NOT NULL DEFAULT '0.000', + PRIMARY KEY (`ok`) +) TYPE={!type!}; + +ALTER TABLE `{!prefix!}_config` ADD `activate_xchange` BIGINT(20) UNSIGNED NOT NULL DEFAULT 100; +ALTER TABLE `{!prefix!}_config` ADD `order_multi_page` ENUM('Y','N') NOT NULL DEFAULT 'Y'; +ALTER TABLE `{!prefix!}_config` ADD `display_refid` ENUM('Y','N') NOT NULL DEFAULT 'Y'; +ALTER TABLE `{!prefix!}_config` ADD `ip_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT 86400; +ALTER TABLE `{!prefix!}_pool` ADD `zip` VARCHAR(6) NOT NULL DEFAULT ''; + +ALTER TABLE `{!prefix!}_task_system` CHANGE `task_type` `task_type` VARCHAR(255) NOT NULL DEFAULT 'FIRST_USER'; +ALTER TABLE `{!prefix!}_config` ADD `allow_direct_pay` ENUM('Y','N') NOT NULL DEFAULT 'N';