Conditions | 1 |
Paths | 1 |
Total Lines | 48 |
Code Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php defined('BASEPATH') OR exit('No direct script access allowed'); |
||
9 | public function up() { |
||
10 | $this->dbforge->add_field(array( |
||
11 | 'id' => array( |
||
12 | 'type' => 'MEDIUMINT', |
||
13 | 'constraint' => '8', |
||
14 | 'unsigned' => TRUE, |
||
15 | 'auto_increment' => TRUE |
||
16 | ), |
||
17 | |||
18 | 'title_id' => array( |
||
19 | 'type' => 'MEDIUMINT', |
||
20 | 'constraint' => '8', |
||
21 | 'unsigned' => TRUE, |
||
22 | 'null' => FALSE |
||
23 | //FOREIGN KEY |
||
24 | ), |
||
25 | |||
26 | 'old_chapter' => array( |
||
27 | 'type' => 'VARCHAR', |
||
28 | 'constraint' => '255', |
||
29 | 'null' => TRUE |
||
30 | ), |
||
31 | 'new_chapter' => array( |
||
32 | 'type' => 'VARCHAR', |
||
33 | 'constraint' => '255', |
||
34 | 'null' => FALSE |
||
35 | ), |
||
36 | |||
37 | 'updated_at' => array( |
||
38 | //Despite not actually creating the field here (it's instead done below), we still need this here so a key can be created properly. |
||
39 | // 'type' => 'TIMESTAMP', |
||
40 | // 'null' => FALSE, |
||
41 | // 'on_update' => FALSE |
||
42 | ) |
||
43 | )); |
||
44 | $this->dbforge->add_field('updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP'); //CI is annoying and auto-appends ON UPDATE which we don't want. |
||
45 | $this->dbforge->add_key('id', TRUE); |
||
46 | $this->dbforge->add_key('title_id'); |
||
47 | $this->dbforge->add_key('updated_at'); |
||
48 | $this->dbforge->create_table('tracker_titles_history'); |
||
49 | |||
50 | /*** Unique/Foreign Keys ***/ |
||
51 | //For whatever reason, dbforge lacks a unique/foreign key function. |
||
52 | $this->db->query(' |
||
53 | ALTER TABLE `tracker_titles_history` |
||
54 | ADD CONSTRAINT `FK_tracker_titles_history_tracker_titles` FOREIGN KEY (`title_id`) REFERENCES `tracker_titles` (`id`) ON UPDATE NO ACTION ON DELETE NO ACTION;' |
||
55 | ); |
||
56 | } |
||
57 | |||
62 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.