diff --git a/application/config/migration.php b/application/config/migration.php index ff346e62..40624644 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 57; +$config['migration_version'] = 59; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/058_new_options_table.php b/application/migrations/058_new_options_table.php new file mode 100644 index 00000000..99bc8239 --- /dev/null +++ b/application/migrations/058_new_options_table.php @@ -0,0 +1,49 @@ +dbforge->add_field(array( + 'option_id' => array( + 'type' => 'BIGINT', + 'constraint' => 20, + 'unsigned' => TRUE, + 'auto_increment' => TRUE + ), + + 'option_name' => array( + 'type' => 'VARCHAR', + 'constraint' => '191', + 'null' => TRUE, + 'unique' => TRUE, + ), + + 'option_value' => array( + 'type' => 'longtext', + ), + + 'autoload' => array( + 'type' => 'varchar', + 'constraint' => '20', + 'null' => TRUE, + ) + )); + + $this->dbforge->add_key('option_id', TRUE); + + $this->dbforge->create_table('options'); + } + + public function down() + { + $this->dbforge->drop_table('options'); + } +} \ No newline at end of file diff --git a/application/migrations/059_add_default_theme_to_options_table.php b/application/migrations/059_add_default_theme_to_options_table.php new file mode 100644 index 00000000..f4d2c748 --- /dev/null +++ b/application/migrations/059_add_default_theme_to_options_table.php @@ -0,0 +1,25 @@ + "theme", 'option_value' => "default", 'autoload' => "yes") + ); + + $this->db->insert_batch('options', $data); + } + + public function down() + { + // No option to down + } +} \ No newline at end of file