@@ -6,8 +6,8 @@ |
||
6 | 6 | //-------------------------------------------------------------------- |
7 | 7 | |
8 | 8 | $config['modules_locations'] = array( |
9 | - APPPATH .'modules/', |
|
10 | - MYTHPATH .'CIModules/' |
|
9 | + APPPATH .'modules/', |
|
10 | + MYTHPATH .'CIModules/' |
|
11 | 11 | ); |
12 | 12 | |
13 | 13 | /* |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | // |
9 | 9 | |
10 | 10 | $config['meta'] = [ |
11 | - 'x-ua-compatible' => 'ie=edge', |
|
12 | - 'viewport' => 'width=device-width, initial-scale=1', |
|
11 | + 'x-ua-compatible' => 'ie=edge', |
|
12 | + 'viewport' => 'width=device-width, initial-scale=1', |
|
13 | 13 | ]; |
14 | 14 | |
15 | 15 | //-------------------------------------------------------------------- |
@@ -20,5 +20,5 @@ discard block |
||
20 | 20 | // |
21 | 21 | |
22 | 22 | $config['http-equiv'] = [ |
23 | - 'x-dns-prefetch-control' |
|
23 | + 'x-dns-prefetch-control' |
|
24 | 24 | ]; |
@@ -83,7 +83,7 @@ |
||
83 | 83 | | The key is the alias that you will refer to when running migrations. |
84 | 84 | */ |
85 | 85 | $config['migration_paths'] = array( |
86 | - 'app' => APPPATH . 'database/migrations/' |
|
86 | + 'app' => APPPATH . 'database/migrations/' |
|
87 | 87 | ); |
88 | 88 | |
89 | 89 |
@@ -4,28 +4,28 @@ |
||
4 | 4 | |
5 | 5 | class MY_Loader extends HMVC_Loader { |
6 | 6 | |
7 | - /** |
|
8 | - * Does the same thing that load->view does except ensures that the |
|
9 | - * view file is treated as a path so that it can be found outside of |
|
10 | - * the standard view paths. |
|
11 | - * |
|
12 | - * @param $view |
|
13 | - * @param array $vars |
|
14 | - * @param bool $return |
|
15 | - * @return object|void |
|
16 | - */ |
|
17 | - public function view_path($view, $vars = array(), $return = FALSE) |
|
18 | - { |
|
19 | - $view .= '.php'; |
|
7 | + /** |
|
8 | + * Does the same thing that load->view does except ensures that the |
|
9 | + * view file is treated as a path so that it can be found outside of |
|
10 | + * the standard view paths. |
|
11 | + * |
|
12 | + * @param $view |
|
13 | + * @param array $vars |
|
14 | + * @param bool $return |
|
15 | + * @return object|void |
|
16 | + */ |
|
17 | + public function view_path($view, $vars = array(), $return = FALSE) |
|
18 | + { |
|
19 | + $view .= '.php'; |
|
20 | 20 | |
21 | - // If the file can't be found, then use the regular view method... |
|
22 | - if (file_exists($view)) { |
|
23 | - return $this->_ci_load(array('_ci_path' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); |
|
24 | - } |
|
25 | - else { |
|
26 | - return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); |
|
27 | - } |
|
28 | - } |
|
21 | + // If the file can't be found, then use the regular view method... |
|
22 | + if (file_exists($view)) { |
|
23 | + return $this->_ci_load(array('_ci_path' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); |
|
24 | + } |
|
25 | + else { |
|
26 | + return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); |
|
27 | + } |
|
28 | + } |
|
29 | 29 | |
30 | - // -------------------------------------------------------------------- |
|
30 | + // -------------------------------------------------------------------- |
|
31 | 31 | } |
@@ -10,86 +10,86 @@ |
||
10 | 10 | */ |
11 | 11 | class Migration_create_auth_tables extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
14 | - { |
|
15 | - // Auth Login Attempts |
|
16 | - $fields = [ |
|
17 | - 'id' => [ |
|
18 | - 'type' => 'int', |
|
19 | - 'constraint' => 11, |
|
20 | - 'unsigned' => true, |
|
21 | - 'auto_increment' => true |
|
22 | - ], |
|
23 | - 'email' => [ |
|
24 | - 'type' => 'varchar', |
|
25 | - 'constraint' => 255, |
|
26 | - ], |
|
27 | - 'datetime' => [ |
|
28 | - 'type' => 'datetime', |
|
29 | - ] |
|
30 | - ]; |
|
31 | - $this->dbforge->add_field($fields); |
|
32 | - $this->dbforge->add_key('id', true); |
|
33 | - $this->dbforge->add_key('email'); |
|
13 | + public function up () |
|
14 | + { |
|
15 | + // Auth Login Attempts |
|
16 | + $fields = [ |
|
17 | + 'id' => [ |
|
18 | + 'type' => 'int', |
|
19 | + 'constraint' => 11, |
|
20 | + 'unsigned' => true, |
|
21 | + 'auto_increment' => true |
|
22 | + ], |
|
23 | + 'email' => [ |
|
24 | + 'type' => 'varchar', |
|
25 | + 'constraint' => 255, |
|
26 | + ], |
|
27 | + 'datetime' => [ |
|
28 | + 'type' => 'datetime', |
|
29 | + ] |
|
30 | + ]; |
|
31 | + $this->dbforge->add_field($fields); |
|
32 | + $this->dbforge->add_key('id', true); |
|
33 | + $this->dbforge->add_key('email'); |
|
34 | 34 | |
35 | - $this->dbforge->create_table('auth_login_attempts', true, config_item('migration_create_table_attr')); |
|
35 | + $this->dbforge->create_table('auth_login_attempts', true, config_item('migration_create_table_attr')); |
|
36 | 36 | |
37 | - // Auth Logins |
|
38 | - $fields = [ |
|
39 | - 'id' => [ |
|
40 | - 'type' => 'int', |
|
41 | - 'constraint' => 11, |
|
42 | - 'unsigned' => true, |
|
43 | - 'auto_increment' => true |
|
44 | - ], |
|
45 | - 'user_id' => [ |
|
46 | - 'type' => 'int', |
|
47 | - 'constraint' => 11, |
|
48 | - ], |
|
49 | - 'ip_address' => [ |
|
50 | - 'type' => 'varchar', |
|
51 | - 'constraint' => 40, |
|
52 | - 'null' => true |
|
53 | - ], |
|
54 | - 'datetime' => [ |
|
55 | - 'type' => 'datetime', |
|
56 | - ] |
|
57 | - ]; |
|
58 | - $this->dbforge->add_field($fields); |
|
59 | - $this->dbforge->add_key('id', true); |
|
60 | - $this->dbforge->add_key('email'); |
|
37 | + // Auth Logins |
|
38 | + $fields = [ |
|
39 | + 'id' => [ |
|
40 | + 'type' => 'int', |
|
41 | + 'constraint' => 11, |
|
42 | + 'unsigned' => true, |
|
43 | + 'auto_increment' => true |
|
44 | + ], |
|
45 | + 'user_id' => [ |
|
46 | + 'type' => 'int', |
|
47 | + 'constraint' => 11, |
|
48 | + ], |
|
49 | + 'ip_address' => [ |
|
50 | + 'type' => 'varchar', |
|
51 | + 'constraint' => 40, |
|
52 | + 'null' => true |
|
53 | + ], |
|
54 | + 'datetime' => [ |
|
55 | + 'type' => 'datetime', |
|
56 | + ] |
|
57 | + ]; |
|
58 | + $this->dbforge->add_field($fields); |
|
59 | + $this->dbforge->add_key('id', true); |
|
60 | + $this->dbforge->add_key('email'); |
|
61 | 61 | |
62 | - $this->dbforge->create_table('auth_logins', true, config_item('migration_create_table_attr')); |
|
62 | + $this->dbforge->create_table('auth_logins', true, config_item('migration_create_table_attr')); |
|
63 | 63 | |
64 | - // Auth Tokens |
|
65 | - $fields = [ |
|
66 | - 'email' => [ |
|
67 | - 'type' => 'varchar', |
|
68 | - 'constraint' => 255, |
|
69 | - ], |
|
70 | - 'hash' => [ |
|
71 | - 'type' => 'char', |
|
72 | - 'constraint' => 40 |
|
73 | - ], |
|
74 | - 'created' => [ |
|
75 | - 'type' => 'datetime', |
|
76 | - ] |
|
77 | - ]; |
|
78 | - $this->dbforge->add_field($fields); |
|
79 | - $this->dbforge->add_key( ['email', 'hash'] ); |
|
64 | + // Auth Tokens |
|
65 | + $fields = [ |
|
66 | + 'email' => [ |
|
67 | + 'type' => 'varchar', |
|
68 | + 'constraint' => 255, |
|
69 | + ], |
|
70 | + 'hash' => [ |
|
71 | + 'type' => 'char', |
|
72 | + 'constraint' => 40 |
|
73 | + ], |
|
74 | + 'created' => [ |
|
75 | + 'type' => 'datetime', |
|
76 | + ] |
|
77 | + ]; |
|
78 | + $this->dbforge->add_field($fields); |
|
79 | + $this->dbforge->add_key( ['email', 'hash'] ); |
|
80 | 80 | |
81 | - $this->dbforge->create_table('auth_tokens', true, config_item('migration_create_table_attr')); |
|
82 | - } |
|
81 | + $this->dbforge->create_table('auth_tokens', true, config_item('migration_create_table_attr')); |
|
82 | + } |
|
83 | 83 | |
84 | - //-------------------------------------------------------------------- |
|
84 | + //-------------------------------------------------------------------- |
|
85 | 85 | |
86 | - public function down () |
|
87 | - { |
|
88 | - $this->dbforge->drop_table('auth_tokens'); |
|
89 | - $this->dbforge->drop_table('auth_logins'); |
|
90 | - $this->dbforge->drop_table('auth_login_attempts'); |
|
91 | - } |
|
86 | + public function down () |
|
87 | + { |
|
88 | + $this->dbforge->drop_table('auth_tokens'); |
|
89 | + $this->dbforge->drop_table('auth_logins'); |
|
90 | + $this->dbforge->drop_table('auth_login_attempts'); |
|
91 | + } |
|
92 | 92 | |
93 | - //-------------------------------------------------------------------- |
|
93 | + //-------------------------------------------------------------------- |
|
94 | 94 | |
95 | 95 | } |
@@ -10,111 +10,111 @@ |
||
10 | 10 | */ |
11 | 11 | class Migration_create_user_tables extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
14 | - { |
|
15 | - // Users |
|
16 | - $fields = [ |
|
17 | - 'id' => [ |
|
18 | - 'type' => 'int', |
|
19 | - 'constraint' => 11, |
|
20 | - 'unsigned' => true, |
|
21 | - 'auto_increment' => true |
|
22 | - ], |
|
23 | - 'email' => [ |
|
24 | - 'type' => 'varchar', |
|
25 | - 'constraint' => 255 |
|
26 | - ], |
|
27 | - 'username' => [ |
|
28 | - 'type' => 'varchar', |
|
29 | - 'constraint' => 30, |
|
30 | - 'null' => true |
|
31 | - ], |
|
32 | - 'password_hash' => [ |
|
33 | - 'type' => 'varchar', |
|
34 | - 'constraint' => 255 |
|
35 | - ], |
|
36 | - 'reset_hash' => [ |
|
37 | - 'type' => 'varchar', |
|
38 | - 'constraint' => 40, |
|
39 | - 'null' => true |
|
40 | - ], |
|
41 | - 'activate_hash' => [ |
|
42 | - 'type' => 'varchar', |
|
43 | - 'constraint' => 40, |
|
44 | - 'null' => true |
|
45 | - ], |
|
46 | - 'created_on' => [ |
|
47 | - 'type' => 'datetime', |
|
48 | - 'default' => '0000-00-00 00:00:00' |
|
49 | - ], |
|
50 | - 'status' => [ |
|
51 | - 'type' => 'varchar', |
|
52 | - 'constraint' => 255, |
|
53 | - 'null' => true |
|
54 | - ], |
|
55 | - 'status_message' => [ |
|
56 | - 'type' => 'varchar', |
|
57 | - 'constraint' => 255, |
|
58 | - 'null' => true |
|
59 | - ], |
|
60 | - 'active' => [ |
|
61 | - 'type' => 'tinyint', |
|
62 | - 'constraint' => 1, |
|
63 | - 'null' => 0, |
|
64 | - 'default' => 0 |
|
65 | - ], |
|
66 | - 'deleted' => [ |
|
67 | - 'type' => 'tinyint', |
|
68 | - 'constraint' => 1, |
|
69 | - 'null' => 0, |
|
70 | - 'default' => 0 |
|
71 | - ], |
|
72 | - 'force_pass_reset' => [ |
|
73 | - 'type' => 'tinyint', |
|
74 | - 'constraint' => 1, |
|
75 | - 'null' => 0, |
|
76 | - 'default' => 0 |
|
77 | - ], |
|
78 | - ]; |
|
13 | + public function up () |
|
14 | + { |
|
15 | + // Users |
|
16 | + $fields = [ |
|
17 | + 'id' => [ |
|
18 | + 'type' => 'int', |
|
19 | + 'constraint' => 11, |
|
20 | + 'unsigned' => true, |
|
21 | + 'auto_increment' => true |
|
22 | + ], |
|
23 | + 'email' => [ |
|
24 | + 'type' => 'varchar', |
|
25 | + 'constraint' => 255 |
|
26 | + ], |
|
27 | + 'username' => [ |
|
28 | + 'type' => 'varchar', |
|
29 | + 'constraint' => 30, |
|
30 | + 'null' => true |
|
31 | + ], |
|
32 | + 'password_hash' => [ |
|
33 | + 'type' => 'varchar', |
|
34 | + 'constraint' => 255 |
|
35 | + ], |
|
36 | + 'reset_hash' => [ |
|
37 | + 'type' => 'varchar', |
|
38 | + 'constraint' => 40, |
|
39 | + 'null' => true |
|
40 | + ], |
|
41 | + 'activate_hash' => [ |
|
42 | + 'type' => 'varchar', |
|
43 | + 'constraint' => 40, |
|
44 | + 'null' => true |
|
45 | + ], |
|
46 | + 'created_on' => [ |
|
47 | + 'type' => 'datetime', |
|
48 | + 'default' => '0000-00-00 00:00:00' |
|
49 | + ], |
|
50 | + 'status' => [ |
|
51 | + 'type' => 'varchar', |
|
52 | + 'constraint' => 255, |
|
53 | + 'null' => true |
|
54 | + ], |
|
55 | + 'status_message' => [ |
|
56 | + 'type' => 'varchar', |
|
57 | + 'constraint' => 255, |
|
58 | + 'null' => true |
|
59 | + ], |
|
60 | + 'active' => [ |
|
61 | + 'type' => 'tinyint', |
|
62 | + 'constraint' => 1, |
|
63 | + 'null' => 0, |
|
64 | + 'default' => 0 |
|
65 | + ], |
|
66 | + 'deleted' => [ |
|
67 | + 'type' => 'tinyint', |
|
68 | + 'constraint' => 1, |
|
69 | + 'null' => 0, |
|
70 | + 'default' => 0 |
|
71 | + ], |
|
72 | + 'force_pass_reset' => [ |
|
73 | + 'type' => 'tinyint', |
|
74 | + 'constraint' => 1, |
|
75 | + 'null' => 0, |
|
76 | + 'default' => 0 |
|
77 | + ], |
|
78 | + ]; |
|
79 | 79 | |
80 | - $this->dbforge->add_field($fields); |
|
81 | - $this->dbforge->add_key('id', true); |
|
82 | - $this->dbforge->add_key('email'); |
|
80 | + $this->dbforge->add_field($fields); |
|
81 | + $this->dbforge->add_key('id', true); |
|
82 | + $this->dbforge->add_key('email'); |
|
83 | 83 | |
84 | - $this->dbforge->create_table('users', true, config_item('migration_create_table_attr')); |
|
84 | + $this->dbforge->create_table('users', true, config_item('migration_create_table_attr')); |
|
85 | 85 | |
86 | - // User Meta |
|
87 | - $fields = [ |
|
88 | - 'user_id' => [ |
|
89 | - 'type' => 'int', |
|
90 | - 'constraint' => 11, |
|
91 | - 'unsigned' => true |
|
92 | - ], |
|
93 | - 'meta_key' => [ |
|
94 | - 'type' => 'varchar', |
|
95 | - 'constraint' => 255 |
|
96 | - ], |
|
97 | - 'meta_value' => [ |
|
98 | - 'type' => 'text', |
|
99 | - 'null' => true |
|
100 | - ], |
|
101 | - ]; |
|
86 | + // User Meta |
|
87 | + $fields = [ |
|
88 | + 'user_id' => [ |
|
89 | + 'type' => 'int', |
|
90 | + 'constraint' => 11, |
|
91 | + 'unsigned' => true |
|
92 | + ], |
|
93 | + 'meta_key' => [ |
|
94 | + 'type' => 'varchar', |
|
95 | + 'constraint' => 255 |
|
96 | + ], |
|
97 | + 'meta_value' => [ |
|
98 | + 'type' => 'text', |
|
99 | + 'null' => true |
|
100 | + ], |
|
101 | + ]; |
|
102 | 102 | |
103 | - $this->dbforge->add_field($fields); |
|
104 | - $this->dbforge->add_key(['user_id', 'meta_key'], true); |
|
103 | + $this->dbforge->add_field($fields); |
|
104 | + $this->dbforge->add_key(['user_id', 'meta_key'], true); |
|
105 | 105 | |
106 | - $this->dbforge->create_table('user_meta', true, config_item('migration_create_table_attr')); |
|
106 | + $this->dbforge->create_table('user_meta', true, config_item('migration_create_table_attr')); |
|
107 | 107 | |
108 | - } |
|
108 | + } |
|
109 | 109 | |
110 | - //-------------------------------------------------------------------- |
|
110 | + //-------------------------------------------------------------------- |
|
111 | 111 | |
112 | - public function down () |
|
113 | - { |
|
114 | - $this->dbforge->drop_table('users'); |
|
115 | - $this->dbforge->drop_table('user_meta'); |
|
116 | - } |
|
112 | + public function down () |
|
113 | + { |
|
114 | + $this->dbforge->drop_table('users'); |
|
115 | + $this->dbforge->drop_table('user_meta'); |
|
116 | + } |
|
117 | 117 | |
118 | - //-------------------------------------------------------------------- |
|
118 | + //-------------------------------------------------------------------- |
|
119 | 119 | |
120 | 120 | } |
@@ -10,35 +10,35 @@ |
||
10 | 10 | */ |
11 | 11 | class Migration_create_settings_table extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
14 | - { |
|
15 | - $fields = [ |
|
16 | - 'name' => [ |
|
17 | - 'type' => 'varchar', |
|
18 | - 'constraint' => 255 |
|
19 | - ], |
|
20 | - 'value' => [ |
|
21 | - 'type' => 'varchar', |
|
22 | - 'constraint' => 255, |
|
23 | - 'null' => true |
|
24 | - ], |
|
25 | - 'group' => [ |
|
26 | - 'type' => 'varchar', |
|
27 | - 'constraint' => 255 |
|
28 | - ] |
|
29 | - ]; |
|
30 | - $this->dbforge->add_field($fields); |
|
31 | - $this->dbforge->add_key(['name', 'group'], true); |
|
32 | - $this->dbforge->create_table('settings', true, config_item('migration_create_table_attr')); |
|
33 | - } |
|
13 | + public function up () |
|
14 | + { |
|
15 | + $fields = [ |
|
16 | + 'name' => [ |
|
17 | + 'type' => 'varchar', |
|
18 | + 'constraint' => 255 |
|
19 | + ], |
|
20 | + 'value' => [ |
|
21 | + 'type' => 'varchar', |
|
22 | + 'constraint' => 255, |
|
23 | + 'null' => true |
|
24 | + ], |
|
25 | + 'group' => [ |
|
26 | + 'type' => 'varchar', |
|
27 | + 'constraint' => 255 |
|
28 | + ] |
|
29 | + ]; |
|
30 | + $this->dbforge->add_field($fields); |
|
31 | + $this->dbforge->add_key(['name', 'group'], true); |
|
32 | + $this->dbforge->create_table('settings', true, config_item('migration_create_table_attr')); |
|
33 | + } |
|
34 | 34 | |
35 | - //-------------------------------------------------------------------- |
|
35 | + //-------------------------------------------------------------------- |
|
36 | 36 | |
37 | - public function down () |
|
38 | - { |
|
39 | - $this->dbforge->drop_table('settings'); |
|
40 | - } |
|
37 | + public function down () |
|
38 | + { |
|
39 | + $this->dbforge->drop_table('settings'); |
|
40 | + } |
|
41 | 41 | |
42 | - //-------------------------------------------------------------------- |
|
42 | + //-------------------------------------------------------------------- |
|
43 | 43 | |
44 | 44 | } |
@@ -10,52 +10,52 @@ |
||
10 | 10 | */ |
11 | 11 | class Migration_create_mail_queue extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
14 | - { |
|
15 | - $fields = [ |
|
16 | - 'id' => [ |
|
17 | - 'type' => 'int', |
|
18 | - 'constraint' => 11, |
|
19 | - 'unsigned' => true, |
|
20 | - 'auto_increment' => true |
|
21 | - ], |
|
22 | - 'mailer' => [ |
|
23 | - 'type' => 'varchar', |
|
24 | - 'constraint' => 255 |
|
25 | - ], |
|
26 | - 'params' => [ |
|
27 | - 'type' => 'text', |
|
28 | - 'null' => true |
|
29 | - ], |
|
30 | - 'options' => [ |
|
31 | - 'type' => 'text', |
|
32 | - 'null' => true |
|
33 | - ], |
|
34 | - 'sent' => [ |
|
35 | - 'type' => 'tinyint', |
|
36 | - 'constraint' => 1, |
|
37 | - 'default' => 0 |
|
38 | - ], |
|
39 | - 'sent_on' => [ |
|
40 | - 'type' => 'datetime', |
|
41 | - 'null' => true, |
|
42 | - 'default' => null |
|
43 | - ], |
|
44 | - ]; |
|
13 | + public function up () |
|
14 | + { |
|
15 | + $fields = [ |
|
16 | + 'id' => [ |
|
17 | + 'type' => 'int', |
|
18 | + 'constraint' => 11, |
|
19 | + 'unsigned' => true, |
|
20 | + 'auto_increment' => true |
|
21 | + ], |
|
22 | + 'mailer' => [ |
|
23 | + 'type' => 'varchar', |
|
24 | + 'constraint' => 255 |
|
25 | + ], |
|
26 | + 'params' => [ |
|
27 | + 'type' => 'text', |
|
28 | + 'null' => true |
|
29 | + ], |
|
30 | + 'options' => [ |
|
31 | + 'type' => 'text', |
|
32 | + 'null' => true |
|
33 | + ], |
|
34 | + 'sent' => [ |
|
35 | + 'type' => 'tinyint', |
|
36 | + 'constraint' => 1, |
|
37 | + 'default' => 0 |
|
38 | + ], |
|
39 | + 'sent_on' => [ |
|
40 | + 'type' => 'datetime', |
|
41 | + 'null' => true, |
|
42 | + 'default' => null |
|
43 | + ], |
|
44 | + ]; |
|
45 | 45 | |
46 | - $this->dbforge->add_field($fields); |
|
47 | - $this->dbforge->add_key('id', true); |
|
48 | - $this->dbforge->add_key('sent'); |
|
49 | - $this->dbforge->create_table('mail_queue', true, config_item('migration_create_table_attr')); |
|
50 | - } |
|
46 | + $this->dbforge->add_field($fields); |
|
47 | + $this->dbforge->add_key('id', true); |
|
48 | + $this->dbforge->add_key('sent'); |
|
49 | + $this->dbforge->create_table('mail_queue', true, config_item('migration_create_table_attr')); |
|
50 | + } |
|
51 | 51 | |
52 | - //-------------------------------------------------------------------- |
|
52 | + //-------------------------------------------------------------------- |
|
53 | 53 | |
54 | - public function down () |
|
55 | - { |
|
56 | - $this->dbforge->drop_table('mail_queue'); |
|
57 | - } |
|
54 | + public function down () |
|
55 | + { |
|
56 | + $this->dbforge->drop_table('mail_queue'); |
|
57 | + } |
|
58 | 58 | |
59 | - //-------------------------------------------------------------------- |
|
59 | + //-------------------------------------------------------------------- |
|
60 | 60 | |
61 | 61 | } |
@@ -10,110 +10,110 @@ |
||
10 | 10 | */ |
11 | 11 | class Migration_create_authorization_tables extends CI_Migration { |
12 | 12 | |
13 | - public function up () |
|
14 | - { |
|
13 | + public function up () |
|
14 | + { |
|
15 | 15 | /** |
16 | 16 | * Groups Table |
17 | 17 | */ |
18 | - $fields = [ |
|
19 | - 'id' => [ |
|
20 | - 'type' => 'int', |
|
21 | - 'constraint' => 11, |
|
22 | - 'unsigned' => true, |
|
23 | - 'auto_increment' => true |
|
24 | - ], |
|
25 | - 'name' => [ |
|
26 | - 'type' => 'varchar', |
|
27 | - 'constraint' => 255 |
|
28 | - ], |
|
29 | - 'description' => [ |
|
30 | - 'type' => 'varchar', |
|
31 | - 'constraint' => 255 |
|
32 | - ] |
|
33 | - ]; |
|
18 | + $fields = [ |
|
19 | + 'id' => [ |
|
20 | + 'type' => 'int', |
|
21 | + 'constraint' => 11, |
|
22 | + 'unsigned' => true, |
|
23 | + 'auto_increment' => true |
|
24 | + ], |
|
25 | + 'name' => [ |
|
26 | + 'type' => 'varchar', |
|
27 | + 'constraint' => 255 |
|
28 | + ], |
|
29 | + 'description' => [ |
|
30 | + 'type' => 'varchar', |
|
31 | + 'constraint' => 255 |
|
32 | + ] |
|
33 | + ]; |
|
34 | 34 | |
35 | - $this->dbforge->add_field($fields); |
|
36 | - $this->dbforge->add_key('id', true); |
|
37 | - $this->dbforge->create_table('auth_groups', true, config_item('migration_create_table_attr')); |
|
38 | - /** |
|
39 | - * Permissions Table |
|
40 | - */ |
|
41 | - $fields = [ |
|
42 | - 'id' => [ |
|
43 | - 'type' => 'int', |
|
44 | - 'constraint' => 11, |
|
45 | - 'unsigned' => true, |
|
46 | - 'auto_increment' => true |
|
47 | - ], |
|
48 | - 'name' => [ |
|
49 | - 'type' => 'varchar', |
|
50 | - 'constraint' => 255 |
|
51 | - ], |
|
52 | - 'description' => [ |
|
53 | - 'type' => 'varchar', |
|
54 | - 'constraint' => 255 |
|
55 | - ] |
|
56 | - ]; |
|
35 | + $this->dbforge->add_field($fields); |
|
36 | + $this->dbforge->add_key('id', true); |
|
37 | + $this->dbforge->create_table('auth_groups', true, config_item('migration_create_table_attr')); |
|
38 | + /** |
|
39 | + * Permissions Table |
|
40 | + */ |
|
41 | + $fields = [ |
|
42 | + 'id' => [ |
|
43 | + 'type' => 'int', |
|
44 | + 'constraint' => 11, |
|
45 | + 'unsigned' => true, |
|
46 | + 'auto_increment' => true |
|
47 | + ], |
|
48 | + 'name' => [ |
|
49 | + 'type' => 'varchar', |
|
50 | + 'constraint' => 255 |
|
51 | + ], |
|
52 | + 'description' => [ |
|
53 | + 'type' => 'varchar', |
|
54 | + 'constraint' => 255 |
|
55 | + ] |
|
56 | + ]; |
|
57 | 57 | |
58 | - $this->dbforge->add_field($fields); |
|
59 | - $this->dbforge->add_key('id', true); |
|
60 | - $this->dbforge->create_table('auth_permissions', true, config_item('migration_create_table_attr')); |
|
58 | + $this->dbforge->add_field($fields); |
|
59 | + $this->dbforge->add_key('id', true); |
|
60 | + $this->dbforge->create_table('auth_permissions', true, config_item('migration_create_table_attr')); |
|
61 | 61 | |
62 | - /** |
|
63 | - * Groups/Permissions Table |
|
64 | - */ |
|
65 | - $fields = [ |
|
66 | - 'group_id' => [ |
|
67 | - 'type' => 'int', |
|
68 | - 'constraint' => 11, |
|
69 | - 'unsigned' => true, |
|
70 | - 'default' => 0 |
|
71 | - ], |
|
72 | - 'permission_id' => [ |
|
73 | - 'type' => 'int', |
|
74 | - 'constraint' => 11, |
|
75 | - 'unsigned' => true, |
|
76 | - 'default' => 0 |
|
77 | - ], |
|
78 | - ]; |
|
62 | + /** |
|
63 | + * Groups/Permissions Table |
|
64 | + */ |
|
65 | + $fields = [ |
|
66 | + 'group_id' => [ |
|
67 | + 'type' => 'int', |
|
68 | + 'constraint' => 11, |
|
69 | + 'unsigned' => true, |
|
70 | + 'default' => 0 |
|
71 | + ], |
|
72 | + 'permission_id' => [ |
|
73 | + 'type' => 'int', |
|
74 | + 'constraint' => 11, |
|
75 | + 'unsigned' => true, |
|
76 | + 'default' => 0 |
|
77 | + ], |
|
78 | + ]; |
|
79 | 79 | |
80 | - $this->dbforge->add_field($fields); |
|
81 | - $this->dbforge->add_key(['group_id', 'permission_id']); |
|
82 | - $this->dbforge->create_table('auth_groups_permissions', true, config_item('migration_create_table_attr')); |
|
80 | + $this->dbforge->add_field($fields); |
|
81 | + $this->dbforge->add_key(['group_id', 'permission_id']); |
|
82 | + $this->dbforge->create_table('auth_groups_permissions', true, config_item('migration_create_table_attr')); |
|
83 | 83 | |
84 | - /** |
|
85 | - * Users/Groups Table |
|
86 | - */ |
|
87 | - $fields = [ |
|
88 | - 'group_id' => [ |
|
89 | - 'type' => 'int', |
|
90 | - 'constraint' => 11, |
|
91 | - 'unsigned' => true, |
|
92 | - 'default' => 0 |
|
93 | - ], |
|
94 | - 'user_id' => [ |
|
95 | - 'type' => 'int', |
|
96 | - 'constraint' => 11, |
|
97 | - 'unsigned' => true, |
|
98 | - 'default' => 0 |
|
99 | - ], |
|
100 | - ]; |
|
84 | + /** |
|
85 | + * Users/Groups Table |
|
86 | + */ |
|
87 | + $fields = [ |
|
88 | + 'group_id' => [ |
|
89 | + 'type' => 'int', |
|
90 | + 'constraint' => 11, |
|
91 | + 'unsigned' => true, |
|
92 | + 'default' => 0 |
|
93 | + ], |
|
94 | + 'user_id' => [ |
|
95 | + 'type' => 'int', |
|
96 | + 'constraint' => 11, |
|
97 | + 'unsigned' => true, |
|
98 | + 'default' => 0 |
|
99 | + ], |
|
100 | + ]; |
|
101 | 101 | |
102 | - $this->dbforge->add_field($fields); |
|
103 | - $this->dbforge->add_key(['group_id', 'user_id']); |
|
104 | - $this->dbforge->create_table('auth_groups_users', true, config_item('migration_create_table_attr')); |
|
105 | - } |
|
102 | + $this->dbforge->add_field($fields); |
|
103 | + $this->dbforge->add_key(['group_id', 'user_id']); |
|
104 | + $this->dbforge->create_table('auth_groups_users', true, config_item('migration_create_table_attr')); |
|
105 | + } |
|
106 | 106 | |
107 | - //-------------------------------------------------------------------- |
|
107 | + //-------------------------------------------------------------------- |
|
108 | 108 | |
109 | - public function down () |
|
110 | - { |
|
109 | + public function down () |
|
110 | + { |
|
111 | 111 | $this->dbforge->drop_table('auth_groups'); |
112 | 112 | $this->dbforge->drop_table('auth_permissions'); |
113 | 113 | $this->dbforge->drop_table('auth_groups_permissions'); |
114 | 114 | $this->dbforge->drop_table('auth_groups_users'); |
115 | - } |
|
115 | + } |
|
116 | 116 | |
117 | - //-------------------------------------------------------------------- |
|
117 | + //-------------------------------------------------------------------- |
|
118 | 118 | |
119 | 119 | } |