@@ -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 | /* |
@@ -29,7 +29,9 @@ |
||
| 29 | 29 | * @link http://sprintphp.com |
| 30 | 30 | * @since Version 1.0 |
| 31 | 31 | */ |
| 32 | -if (!defined('BASEPATH')) exit('No direct script access allowed'); |
|
| 32 | +if (!defined('BASEPATH')) { |
|
| 33 | + exit('No direct script access allowed'); |
|
| 34 | +} |
|
| 33 | 35 | |
| 34 | 36 | //-------------------------------------------------------------------- |
| 35 | 37 | // Allowed Environments |
@@ -37,10 +37,10 @@ discard block |
||
| 37 | 37 | // Before any _generators are run, the current environment will be |
| 38 | 38 | // tested to verify it's an allowed environment. |
| 39 | 39 | // |
| 40 | - $config['forge.allowed_environments'] = [ |
|
| 41 | - 'development', |
|
| 42 | - 'travis' |
|
| 43 | - ]; |
|
| 40 | + $config['forge.allowed_environments'] = [ |
|
| 41 | + 'development', |
|
| 42 | + 'travis' |
|
| 43 | + ]; |
|
| 44 | 44 | |
| 45 | 45 | //-------------------------------------------------------------------- |
| 46 | 46 | // Themer to Use |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | // Define the themer to use when rendering our template files. |
| 49 | 49 | // This should include the fully namespaced classname. |
| 50 | 50 | // |
| 51 | - $config['forge.themer'] = '\Myth\Themers\ViewThemer'; |
|
| 51 | + $config['forge.themer'] = '\Myth\Themers\ViewThemer'; |
|
| 52 | 52 | |
| 53 | 53 | //-------------------------------------------------------------------- |
| 54 | 54 | // Generator Collections |
@@ -60,6 +60,6 @@ discard block |
||
| 60 | 60 | // |
| 61 | 61 | // The 'keys' are aliases that can be used to reference the view from. |
| 62 | 62 | // |
| 63 | - $config['forge.collections'] = [ |
|
| 64 | - 'sprint' => MYTHPATH .'_generators/' |
|
| 65 | - ]; |
|
| 66 | 63 | \ No newline at end of file |
| 64 | + $config['forge.collections'] = [ |
|
| 65 | + 'sprint' => MYTHPATH .'_generators/' |
|
| 66 | + ]; |
|
| 67 | 67 | \ No newline at end of file |
@@ -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 | } |
@@ -43,8 +43,7 @@ |
||
| 43 | 43 | if (is_object($ci)) |
| 44 | 44 | { |
| 45 | 45 | $this->ci =& $ci; |
| 46 | - } |
|
| 47 | - else { |
|
| 46 | + } else { |
|
| 48 | 47 | $this->ci =& get_instance(); |
| 49 | 48 | } |
| 50 | 49 | |
@@ -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 | } |