addCreateTableSql() is now more encapsulated
[mailer.git] / inc / extensions / ext-rallye.php
index f61119bbce32c1f318c84cd6b75631ded695d9de..6bdaf75503c913f0e7e6f2515745b1b29acbade4 100644 (file)
@@ -50,7 +50,7 @@ switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running
                // SQL commands to run
                addDropTableSql('rallye_data');
-               addCreateTableSql('rallye_data', "(
+               addCreateTableSql('rallye_data', "
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `title` VARCHAR(255) NOT NULL DEFAULT '',
@@ -62,29 +62,31 @@ switch (getExtensionMode()) {
 `is_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
 `send_notify` ENUM('Y','N') NOT NULL DEFAULT 'Y',
 `notified` ENUM('Y','N') NOT NULL DEFAULT 'N',
-KEY (`admin_id`),
-PRIMARY KEY (`id`)
-) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Main rallye data'");
+PRIMARY KEY (`id`),
+KEY (`admin_id`)",
+                       'Main rallye data');
+
                addDropTableSql('rallye_prices');
-               addCreateTableSql('rallye_prices', "(
+               addCreateTableSql('rallye_prices', "
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `rallye_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `price_level` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `info` LONGTEXT NOT NULL,
-INDEX (`rallye_id`),
-PRIMARY KEY (`id`)
-) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Prices data for a rallye'");
+PRIMARY KEY (`id`),
+INDEX (`rallye_id`)",
+                       'Prices data for a rallye');
+
                addDropTableSql('rallye_users');
-               addCreateTableSql('rallye_users', "(
+               addCreateTableSql('rallye_users', "
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `rallye_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `refs` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`id`),
 INDEX (`rallye_id`),
-INDEX (`userid`),
-PRIMARY KEY (`id`)
-) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Rallye->user connection table'");
+INDEX (`userid`)",
+                       'Rallye->user connection table');
 
                // Admin menu
                addAdminMenuSql('rallye', NULL, 'Rallye-Management','Richten Sie neue Ref-Rallyes ein, die zeitgesteuert anfangen und aufhöhren. Dabei wird alles weitere automatisch geregelt.',9);