PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.2.0
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.2.0
4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 4.2.1 All 138 releases
learnpress / config / table / tables-v4.php

tables-v4.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.2.0, at config/table/tables-v4.php

157 lines 5.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * List tables for the database
4 *
5 * @version 4
6 * @since 4.1.6.4
7 * @version 1.0.0
8 */
9
10 $lp_db = LP_Database::getInstance();
11
12 $collate = $lp_db->wpdb->has_cap( 'collation' ) ? $lp_db->wpdb->get_charset_collate() : '';
13
14 // Max DB index length. See wp_get_db_schema().
15 $max_index_length = 191;
16
17 return array(
18 $lp_db->tb_lp_order_items => "
19 CREATE TABLE IF NOT EXISTS {$lp_db->tb_lp_order_items} (
20 order_item_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
21 order_item_name longtext NOT NULL,
22 order_id bigint(20) unsigned NOT NULL DEFAULT 0,
23 item_id bigint(20) unsigned NOT NULL DEFAULT 0,
24 item_type varchar(45) NOT NULL DEFAULT '',
25 PRIMARY KEY (order_item_id),
26 KEY order_id (order_id),
27 KEY item_id (item_id),
28 KEY item_type (item_type)
29 ) $collate;
30 ",
31 $lp_db->tb_lp_order_itemmeta => "
32 CREATE TABLE IF NOT EXISTS {$lp_db->tb_lp_order_itemmeta} (
33 meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
34 learnpress_order_item_id bigint(20) unsigned NOT NULL DEFAULT '0',
35 meta_key varchar(255) NOT NULL DEFAULT '',
36 meta_value varchar(255) NULL,
37 extra_value longtext,
38 PRIMARY KEY (meta_id),
39 KEY learnpress_order_item_id (learnpress_order_item_id),
40 KEY meta_key (meta_key({$max_index_length})),
41 KEY meta_value (meta_value({$max_index_length}))
42 ) $collate;
43 ",
44 $lp_db->tb_lp_question_answers => "
45 CREATE TABLE IF NOT EXISTS {$lp_db->tb_lp_question_answers} (
46 question_answer_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
47 question_id bigint(20) unsigned NOT NULL DEFAULT '0',
48 title text NOT NULL,
49 `value` varchar(32) NOT NULL,
50 `order` bigint(20) unsigned NOT NULL DEFAULT '1',
51 is_true varchar(3),
52 PRIMARY KEY (question_answer_id),
53 KEY question_id (question_id)
54 ) $collate;
55 ",
56 $lp_db->tb_lp_question_answermeta => "
57 CREATE TABLE IF NOT EXISTS {$lp_db->tb_lp_question_answermeta} (
58 meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
59 learnpress_question_answer_id bigint(20) unsigned NOT NULL,
60 meta_key varchar(255) NOT NULL DEFAULT '',
61 meta_value longtext NULL,
62 PRIMARY KEY (meta_id),
63 KEY question_answer_meta (learnpress_question_answer_id, meta_key(150))
64 ) $collate;
65 ",
66 $lp_db->tb_lp_quiz_questions => "
67 CREATE TABLE IF NOT EXISTS {$lp_db->tb_lp_quiz_questions} (
68 quiz_question_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
69 quiz_id bigint(20) unsigned NOT NULL DEFAULT '0',
70 question_id bigint(20) unsigned NOT NULL DEFAULT '0',
71 question_order bigint(20) unsigned NOT NULL DEFAULT '1',
72 PRIMARY KEY (quiz_question_id),
73 KEY quiz_id (quiz_id),
74 KEY question_id (question_id)
75 ) $collate;
76 ",
77 $lp_db->tb_lp_section_items => "
78 CREATE TABLE IF NOT EXISTS {$lp_db->tb_lp_section_items} (
79 section_item_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
80 section_id bigint(20) unsigned NOT NULL DEFAULT '0',
81 item_id bigint(20) unsigned NOT NULL DEFAULT '0',
82 item_order bigint(20) unsigned NOT NULL DEFAULT '0',
83 item_type varchar(45),
84 PRIMARY KEY (section_item_id),
85 KEY section_item (`section_id`, `item_id`)
86 ) $collate;
87 ",
88 $lp_db->tb_lp_sections => "
89 CREATE TABLE IF NOT EXISTS {$lp_db->tb_lp_sections} (
90 section_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
91 section_name varchar(255) NOT NULL DEFAULT '',
92 section_course_id bigint(20) unsigned NOT NULL DEFAULT '0',
93 section_order bigint(10) unsigned NOT NULL DEFAULT '1',
94 section_description longtext NOT NULL,
95 PRIMARY KEY (section_id),
96 KEY section_course_id (section_course_id)
97 ) $collate;
98 ",
99 $lp_db->tb_lp_sessions => "
100 CREATE TABLE IF NOT EXISTS {$lp_db->tb_lp_sessions} (
101 session_id bigint(20) NOT NULL AUTO_INCREMENT,
102 session_key char(32) NOT NULL,
103 session_value longtext NOT NULL,
104 session_expiry bigint(20) NOT NULL,
105 UNIQUE KEY session_id (session_id),
106 PRIMARY KEY (session_key)
107 ) $collate;
108 ",
109 $lp_db->tb_lp_user_items => "
110 CREATE TABLE IF NOT EXISTS {$lp_db->tb_lp_user_items} (
111 user_item_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
112 user_id bigint(20) unsigned NOT NULL DEFAULT '0',
113 item_id bigint(20) unsigned NOT NULL DEFAULT '0',
114 start_time datetime NULL DEFAULT NULL,
115 end_time datetime NULL DEFAULT NULL,
116 item_type varchar(45) NOT NULL DEFAULT '',
117 status varchar(45) NOT NULL DEFAULT '',
118 graduation varchar(20) NULL DEFAULT NULL,
119 access_level int(3) NOT NULL DEFAULT 50,
120 ref_id bigint(20) unsigned NOT NULL DEFAULT '0',
121 ref_type varchar(45) DEFAULT '',
122 parent_id bigint(20) unsigned NOT NULL DEFAULT '0',
123 PRIMARY KEY (user_item_id),
124 KEY parent_id (parent_id),
125 KEY user_id (user_id),
126 KEY item_id (item_id),
127 KEY item_type (item_type),
128 KEY ref_id (ref_id),
129 KEY ref_type (ref_type),
130 KEY status (status)
131 ) $collate;
132 ",
133 $lp_db->tb_lp_user_itemmeta => "
134 CREATE TABLE IF NOT EXISTS {$lp_db->tb_lp_user_itemmeta} (
135 meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
136 learnpress_user_item_id bigint(20) unsigned NOT NULL,
137 meta_key varchar(255) NOT NULL DEFAULT '',
138 meta_value varchar(255) NULL,
139 extra_value longtext NULL,
140 PRIMARY KEY (meta_id),
141 KEY learnpress_user_item_id (learnpress_user_item_id),
142 KEY meta_key (meta_key({$max_index_length})),
143 KEY meta_value (meta_value({$max_index_length}))
144 ) $collate;
145 ",
146 $lp_db->tb_lp_user_item_results => "
147 CREATE TABLE IF NOT EXISTS {$lp_db->tb_lp_user_item_results} (
148 id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
149 user_item_id bigint(20) unsigned NOT NULL,
150 result longtext NULL,
151 PRIMARY KEY (id),
152 KEY user_item_id (user_item_id)
153 ) $collate;
154 ",
155 );
156
157