wp-all-export
Last commit date
actions
9 years ago
classes
9 years ago
config
9 years ago
controllers
9 years ago
filters
9 years ago
helpers
9 years ago
history
9 years ago
i18n
9 years ago
libraries
9 years ago
models
9 years ago
sessions
9 years ago
shortcodes
9 years ago
src
9 years ago
static
9 years ago
views
9 years ago
banner-772x250.png
9 years ago
readme.txt
9 years ago
schema.php
9 years ago
screenshot-1.png
9 years ago
screenshot-2.png
9 years ago
wp-all-export.php
9 years ago
schema.php
62 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin database schema |
| 4 | * WARNING: |
| 5 | * dbDelta() doesn't like empty lines in schema string, so don't put them there; |
| 6 | * WPDB doesn't like NULL values so better not to have them in the tables; |
| 7 | */ |
| 8 | |
| 9 | /** |
| 10 | * The database character collate. |
| 11 | * @var string |
| 12 | * @global string |
| 13 | * @name $charset_collate |
| 14 | */ |
| 15 | $charset_collate = ''; |
| 16 | |
| 17 | // Declare these as global in case schema.php is included from a function. |
| 18 | global $wpdb, $plugin_queries; |
| 19 | |
| 20 | if ( ! empty($wpdb->charset)) |
| 21 | $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
| 22 | if ( ! empty($wpdb->collate)) |
| 23 | $charset_collate .= " COLLATE $wpdb->collate"; |
| 24 | |
| 25 | $table_prefix = PMXE_Plugin::getInstance()->getTablePrefix(); |
| 26 | |
| 27 | $plugin_queries = <<<SCHEMA |
| 28 | CREATE TABLE {$table_prefix}posts ( |
| 29 | id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
| 30 | post_id BIGINT(20) UNSIGNED NOT NULL, |
| 31 | export_id BIGINT(20) UNSIGNED NOT NULL, |
| 32 | iteration BIGINT(20) NOT NULL DEFAULT 0, |
| 33 | PRIMARY KEY (id) |
| 34 | ) $charset_collate; |
| 35 | CREATE TABLE {$table_prefix}templates ( |
| 36 | id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
| 37 | name VARCHAR(200) NOT NULL DEFAULT '', |
| 38 | options LONGTEXT, |
| 39 | PRIMARY KEY (id) |
| 40 | ) $charset_collate; |
| 41 | CREATE TABLE {$table_prefix}exports ( |
| 42 | id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
| 43 | parent_id BIGINT(20) NOT NULL DEFAULT 0, |
| 44 | attch_id BIGINT(20) NOT NULL DEFAULT 0, |
| 45 | options LONGTEXT, |
| 46 | scheduled VARCHAR(64) NOT NULL DEFAULT '', |
| 47 | registered_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 48 | friendly_name VARCHAR(64) NOT NULL DEFAULT '', |
| 49 | exported BIGINT(20) NOT NULL DEFAULT 0, |
| 50 | canceled BOOL NOT NULL DEFAULT 0, |
| 51 | canceled_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 52 | settings_update_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 53 | last_activity DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 54 | processing BOOL NOT NULL DEFAULT 0, |
| 55 | executing BOOL NOT NULL DEFAULT 0, |
| 56 | triggered BOOL NOT NULL DEFAULT 0, |
| 57 | iteration BIGINT(20) NOT NULL DEFAULT 0, |
| 58 | export_post_type VARCHAR(64) NOT NULL DEFAULT '', |
| 59 | PRIMARY KEY (id) |
| 60 | ) $charset_collate; |
| 61 | SCHEMA; |
| 62 |