wp-all-import
Last commit date
actions
13 years ago
classes
13 years ago
config
13 years ago
controllers
13 years ago
filters
13 years ago
helpers
13 years ago
history
13 years ago
libraries
13 years ago
logs
13 years ago
models
13 years ago
shortcodes
13 years ago
static
13 years ago
upload
13 years ago
views
13 years ago
plugin.php
13 years ago
readme.txt
13 years ago
schema.php
13 years ago
screenshot-1.png
13 years ago
screenshot-2.png
13 years ago
screenshot-3.png
13 years ago
screenshot-4.png
13 years ago
schema.php
80 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 = PMXI_Plugin::getInstance()->getTablePrefix(); |
| 26 | |
| 27 | $plugin_queries = <<<SCHEMA |
| 28 | CREATE TABLE {$table_prefix}templates ( |
| 29 | id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
| 30 | options TEXT, |
| 31 | scheduled VARCHAR(64) NOT NULL DEFAULT '', |
| 32 | name VARCHAR(200) NOT NULL DEFAULT '', |
| 33 | title TEXT, |
| 34 | content LONGTEXT, |
| 35 | is_keep_linebreaks TINYINT(1) NOT NULL DEFAULT 0, |
| 36 | is_leave_html TINYINT(1) NOT NULL DEFAULT 0, |
| 37 | PRIMARY KEY (id) |
| 38 | ) $charset_collate; |
| 39 | CREATE TABLE {$table_prefix}imports ( |
| 40 | id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
| 41 | name VARCHAR(255) NOT NULL DEFAULT '', |
| 42 | friendly_name VARCHAR(255) NOT NULL DEFAULT '', |
| 43 | type VARCHAR(32) NOT NULL DEFAULT '', |
| 44 | path TEXT, |
| 45 | xpath VARCHAR(255) NOT NULL DEFAULT '', |
| 46 | template LONGTEXT, |
| 47 | options TEXT, |
| 48 | scheduled VARCHAR(64) NOT NULL DEFAULT '', |
| 49 | registered_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 50 | large_import ENUM('Yes','No') NOT NULL DEFAULT 'No', |
| 51 | root_element VARCHAR(255) DEFAULT '', |
| 52 | processing BOOL NOT NULL DEFAULT '0', |
| 53 | triggered BOOL NOT NULL DEFAULT '0', |
| 54 | queue_chunk_number BIGINT(20) NOT NULL DEFAULT '0', |
| 55 | current_post_ids TEXT NULL DEFAULT '', |
| 56 | first_import TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, |
| 57 | count BIGINT(20) NOT NULL DEFAULT '0', |
| 58 | imported BIGINT(20) NOT NULL DEFAULT '0', |
| 59 | created BIGINT(20) NOT NULL DEFAULT '0', |
| 60 | updated BIGINT(20) NOT NULL DEFAULT '0', |
| 61 | skipped BIGINT(20) NOT NULL DEFAULT '0', |
| 62 | PRIMARY KEY (id) |
| 63 | ) $charset_collate; |
| 64 | CREATE TABLE {$table_prefix}posts ( |
| 65 | id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
| 66 | post_id BIGINT(20) UNSIGNED NOT NULL, |
| 67 | import_id BIGINT(20) UNSIGNED NOT NULL, |
| 68 | unique_key TEXT, |
| 69 | PRIMARY KEY (id) |
| 70 | ) $charset_collate; |
| 71 | CREATE TABLE {$table_prefix}files ( |
| 72 | id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, |
| 73 | import_id BIGINT(20) UNSIGNED NOT NULL, |
| 74 | name VARCHAR(255) NOT NULL DEFAULT '', |
| 75 | path TEXT, |
| 76 | registered_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', |
| 77 | PRIMARY KEY (id) |
| 78 | ) $charset_collate; |
| 79 | SCHEMA; |
| 80 |