mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
THEME MODE - add theme_mode to db
This commit is contained in:
@@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
||||
|
|
||||
*/
|
||||
|
||||
$config['migration_version'] = 173;
|
||||
$config['migration_version'] = 174;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
34
application/migrations/174_add_theme_mode.php
Normal file
34
application/migrations/174_add_theme_mode.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Migration_add_theme_mode extends CI_Migration {
|
||||
|
||||
public function up() {
|
||||
$fields = array(
|
||||
'theme_mode VARCHAR(20) AFTER foldername',
|
||||
);
|
||||
|
||||
if (!$this->db->field_exists('theme_mode', 'themes')) {
|
||||
$this->dbforge->add_column('themes', $fields);
|
||||
}
|
||||
|
||||
$this->db->query("UPDATE themes SET theme_mode = 'light' WHERE foldername = 'cosmo'");
|
||||
$this->db->query("UPDATE themes SET theme_mode = 'light' WHERE foldername = 'cosmo_wide'");
|
||||
$this->db->query("UPDATE themes SET theme_mode = 'dark' WHERE foldername = 'cyborg'");
|
||||
$this->db->query("UPDATE themes SET theme_mode = 'dark' WHERE foldername = 'cyborg_wide'");
|
||||
$this->db->query("UPDATE themes SET theme_mode = 'dark' WHERE foldername = 'darkly'");
|
||||
$this->db->query("UPDATE themes SET theme_mode = 'dark' WHERE foldername = 'darkly_wide'");
|
||||
$this->db->query("UPDATE themes SET theme_mode = 'light' WHERE foldername = 'default'");
|
||||
$this->db->query("UPDATE themes SET theme_mode = 'light' WHERE foldername = 'default_wide'");
|
||||
$this->db->query("UPDATE themes SET theme_mode = 'dark' WHERE foldername = 'superhero'");
|
||||
$this->db->query("UPDATE themes SET theme_mode = 'dark' WHERE foldername = 'superhero_wide'");
|
||||
}
|
||||
|
||||
|
||||
public function down(){
|
||||
if ($this->db->field_exists('theme_mode', 'themes')) {
|
||||
$this->dbforge->drop_column('themes', 'theme_mode');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user