Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 196 | PointedEar | 1 | <?php |
| 2 | |||
| 3 | class SeriesTable extends \PointedEars\PHPX\Db\MySQLTable |
||
| 4 | { |
||
| 5 | /** |
||
| 6 | * (non-PHPdoc) |
||
| 7 | * @see \PointedEars\PHPX\Db\Table::$_name |
||
| 8 | */ |
||
| 9 | protected static $_name = 'series'; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * (non-PHPdoc) |
||
| 13 | * @see \PointedEars\PHPX\Db\Table::$_columns |
||
| 14 | */ |
||
| 15 | protected static $_columns = array( |
||
| 16 | /* UNSIGNED INT NOT NULL AUTO_INCREMENT */ |
||
| 17 | 'series_id' => array( |
||
| 18 | 'type' => 'INT', |
||
| 19 | 'unsigned' => true, |
||
| 20 | 'not_null' => true, |
||
| 21 | 'auto_inc' => true |
||
| 22 | ), |
||
| 23 | |||
| 24 | /* VARCHAR(45) NOT NULL */ |
||
| 25 | 'title' => array( |
||
| 26 | 'type' => 'VARCHAR(45)', |
||
| 27 | 'not_null' => true |
||
| 28 | ), |
||
| 29 | |||
| 30 | /* BIT NOT NULL DEFAULT 0 */ |
||
| 31 | 'ignore' => array( |
||
| 32 | 'type' => 'BIT', |
||
| 33 | 'not_null' => true, |
||
| 34 | 'default' => 0 |
||
| 35 | ), |
||
| 36 | |||
| 37 | /* INT UNSIGNED NOT NULL */ |
||
| 38 | 'channel_id' => array( |
||
| 39 | 'type' => 'INT', |
||
| 40 | 'unsigned' => true, |
||
| 41 | 'not_null' => true |
||
| 42 | ), |
||
| 43 | |||
| 44 | /* DATETIME NULL */ |
||
| 45 | 'last_seen' => array( |
||
| 46 | 'type' => 'DATETIME', |
||
| 47 | ), |
||
| 48 | |||
| 49 | /* VARCHAR(45) NULL */ |
||
| 50 | 'seasons' => array( |
||
| 51 | 'type' => 'VARCHAR(45)', |
||
| 52 | ), |
||
| 53 | |||
| 54 | /* VARCHAR(45) NULL */ |
||
| 55 | 'url' => array( |
||
| 56 | 'type' => 'VARCHAR(45)', |
||
| 57 | ) |
||
| 58 | ); |
||
| 59 | |||
| 60 | /** |
||
| 61 | * (non-PHPdoc) |
||
| 62 | * @see \PointedEars\PHPX\Db\Table::$_indexes |
||
| 63 | */ |
||
| 64 | protected static $_indexes = array( |
||
| 65 | /* UNIQUE INDEX `title_UNIQUE` (`title` ASC) */ |
||
| 66 | 'title_UNIQUE' => array( |
||
| 67 | 'unique' => true, |
||
| 68 | 'columns' => array('title' => 'ASC') |
||
| 69 | ), |
||
| 70 | |||
| 71 | /* PRIMARY KEY (`series_id`) */ |
||
| 72 | 'PRIMARY' => array( |
||
| 73 | 'columns' => array('series_id') |
||
| 74 | ), |
||
| 75 | |||
| 76 | /* INDEX `fk_series_channel` (`channel_id` ASC) */ |
||
| 77 | 'fk_series_channel' => array( |
||
| 78 | 'columns' => array('channel_id' => 'ASC') |
||
| 79 | ) |
||
| 80 | ); |
||
| 81 | |||
| 82 | /* |
||
| 83 | * CONSTRAINT `fk_series_channel` |
||
| 84 | * FOREIGN KEY (`channel_id` ) |
||
| 85 | * REFERENCES `series`.`channel` (`channel_id` ) |
||
| 86 | * ON DELETE NO ACTION |
||
| 87 | * ON UPDATE NO ACTION |
||
| 88 | */ |
||
| 89 | /** |
||
| 90 | * (non-PHPdoc) |
||
| 91 | * @see \PointedEars\PHPX\Db\Table::$_constraints |
||
| 92 | */ |
||
| 93 | protected static $_constraints = array( |
||
| 94 | 'foreign_keys' => array( |
||
| 95 | 'fk_series_channel' => array( |
||
| 96 | 'columns' => array('channel_id'), |
||
| 97 | 'references_table' => array('series', 'channel'), |
||
| 98 | 'references_columns' => array('channel_id'), |
||
| 99 | 'rules' => array( |
||
| 100 | 'ON DELETE' => 'NO ACTION', |
||
| 101 | 'ON UPDATE' => 'NO ACTION' |
||
| 102 | ) |
||
| 103 | ) |
||
| 104 | ) |
||
| 105 | ); |
||
| 106 | |||
| 107 | /* ENGINE = InnoDB */ |
||
| 108 | /** |
||
| 109 | * (non-PHPdoc) |
||
| 110 | * @see \PointedEars\PHPX\Db\MySQLTable::$_engine |
||
| 111 | */ |
||
| 112 | protected static $_engine = 'InnoDB'; |
||
| 113 | } |