application/migrations/005_auth_add_apikey.php 1 location
|
@@ 3-23 (lines=21) @@
|
| 1 |
|
<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
| 2 |
|
|
| 3 |
|
class Migration_Auth_add_apikey extends CI_Migration { |
| 4 |
|
public function __construct() { |
| 5 |
|
parent::__construct(); |
| 6 |
|
$this->load->dbforge(); |
| 7 |
|
} |
| 8 |
|
|
| 9 |
|
public function up() { |
| 10 |
|
$fields = array( |
| 11 |
|
'api_key' => array( |
| 12 |
|
'type' => 'CHAR', |
| 13 |
|
'constraint' => '32', |
| 14 |
|
'null' => TRUE |
| 15 |
|
) |
| 16 |
|
); |
| 17 |
|
$this->dbforge->add_column('auth_users', $fields, 'password'); |
| 18 |
|
} |
| 19 |
|
|
| 20 |
|
public function down() { |
| 21 |
|
$this->dbforge->drop_column('auth_users', 'api_key'); |
| 22 |
|
} |
| 23 |
|
} |
| 24 |
|
|
application/migrations/008_tracker_add_complete.php 1 location
|
@@ 3-24 (lines=22) @@
|
| 1 |
|
<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
| 2 |
|
|
| 3 |
|
class Migration_Tracker_add_complete extends CI_Migration { |
| 4 |
|
public function __construct() { |
| 5 |
|
parent::__construct(); |
| 6 |
|
$this->load->dbforge(); |
| 7 |
|
} |
| 8 |
|
|
| 9 |
|
public function up() { |
| 10 |
|
$fields = array( |
| 11 |
|
'complete' => array( |
| 12 |
|
'type' => 'ENUM("Y", "N")', |
| 13 |
|
'null' => FALSE, |
| 14 |
|
'default' => 'N' |
| 15 |
|
), |
| 16 |
|
); |
| 17 |
|
$this->dbforge->add_key('complete'); |
| 18 |
|
$this->dbforge->add_column('tracker_titles', $fields, 'latest_chapter'); |
| 19 |
|
} |
| 20 |
|
|
| 21 |
|
public function down() { |
| 22 |
|
$this->dbforge->drop_column('tracker_titles', 'complete'); |
| 23 |
|
} |
| 24 |
|
} |
| 25 |
|
|
application/migrations/009_tracker_add_tags.php 1 location
|
@@ 3-24 (lines=22) @@
|
| 1 |
|
<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
| 2 |
|
|
| 3 |
|
class Migration_Tracker_add_tags extends CI_Migration { |
| 4 |
|
public function __construct() { |
| 5 |
|
parent::__construct(); |
| 6 |
|
$this->load->dbforge(); |
| 7 |
|
} |
| 8 |
|
|
| 9 |
|
public function up() { |
| 10 |
|
$fields = array( |
| 11 |
|
'tags' => array( |
| 12 |
|
'type' => 'VARCHAR', |
| 13 |
|
'constraint' => '255', |
| 14 |
|
'null' => FALSE, |
| 15 |
|
'default' => '' |
| 16 |
|
), |
| 17 |
|
); |
| 18 |
|
$this->dbforge->add_column('tracker_chapters', $fields, 'current_chapter'); |
| 19 |
|
} |
| 20 |
|
|
| 21 |
|
public function down() { |
| 22 |
|
$this->dbforge->drop_column('tracker_chapters', 'tags'); |
| 23 |
|
} |
| 24 |
|
} |
| 25 |
|
|
application/migrations/010_tracker_add_category.php 1 location
|
@@ 3-24 (lines=22) @@
|
| 1 |
|
<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
| 2 |
|
|
| 3 |
|
class Migration_Tracker_add_category extends CI_Migration { |
| 4 |
|
public function __construct() { |
| 5 |
|
parent::__construct(); |
| 6 |
|
$this->load->dbforge(); |
| 7 |
|
} |
| 8 |
|
|
| 9 |
|
public function up() { |
| 10 |
|
$fields = array( |
| 11 |
|
'category' => array( |
| 12 |
|
'type' => 'ENUM("reading", "on-hold", "plan-to-read", "custom1", "custom2", "custom3")', |
| 13 |
|
'null' => FALSE, |
| 14 |
|
'default' => 'reading' |
| 15 |
|
), |
| 16 |
|
); |
| 17 |
|
$this->dbforge->add_key('category'); |
| 18 |
|
$this->dbforge->add_column('tracker_chapters', $fields, 'tags'); |
| 19 |
|
} |
| 20 |
|
|
| 21 |
|
public function down() { |
| 22 |
|
$this->dbforge->drop_column('tracker_chapters', 'category'); |
| 23 |
|
} |
| 24 |
|
} |
| 25 |
|
|
application/migrations/012_tracker_add_site_status.php 1 location
|
@@ 3-24 (lines=22) @@
|
| 1 |
|
<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
| 2 |
|
|
| 3 |
|
class Migration_Tracker_Add_Site_Status extends CI_Migration { |
| 4 |
|
public function __construct() { |
| 5 |
|
parent::__construct(); |
| 6 |
|
$this->load->dbforge(); |
| 7 |
|
} |
| 8 |
|
|
| 9 |
|
public function up() { |
| 10 |
|
$fields = array( |
| 11 |
|
'status' => array( |
| 12 |
|
'type' => 'ENUM("enabled", "disabled", "other")', |
| 13 |
|
'null' => FALSE, |
| 14 |
|
'default' => 'enabled' |
| 15 |
|
), |
| 16 |
|
); |
| 17 |
|
$this->dbforge->add_key('status'); |
| 18 |
|
$this->dbforge->add_column('tracker_sites', $fields, 'site_class'); |
| 19 |
|
} |
| 20 |
|
|
| 21 |
|
public function down() { |
| 22 |
|
$this->dbforge->drop_column('tracker_sites', 'status'); |
| 23 |
|
} |
| 24 |
|
} |
| 25 |
|
|
application/migrations/014_tracker_add_active.php 1 location
|
@@ 3-24 (lines=22) @@
|
| 1 |
|
<?php defined('BASEPATH') OR exit('No direct script access allowed'); |
| 2 |
|
|
| 3 |
|
class Migration_Tracker_Add_Active extends CI_Migration { |
| 4 |
|
public function __construct() { |
| 5 |
|
parent::__construct(); |
| 6 |
|
$this->load->dbforge(); |
| 7 |
|
} |
| 8 |
|
|
| 9 |
|
public function up() { |
| 10 |
|
$fields = array( |
| 11 |
|
'active' => array( |
| 12 |
|
'type' => 'ENUM("Y", "N")', |
| 13 |
|
'null' => FALSE, |
| 14 |
|
'default' => 'Y' |
| 15 |
|
), |
| 16 |
|
); |
| 17 |
|
$this->dbforge->add_key('active'); |
| 18 |
|
$this->dbforge->add_column('tracker_chapters', $fields, 'category'); |
| 19 |
|
} |
| 20 |
|
|
| 21 |
|
public function down() { |
| 22 |
|
$this->dbforge->drop_column('tracker_chapters', 'active'); |
| 23 |
|
} |
| 24 |
|
} |
| 25 |
|
|