diff --git a/application/config/migration.php b/application/config/migration.php index 5b216f92..227bc690 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'] = 70; +$config['migration_version'] = 71; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/071_create_station_logbook_table.php b/application/migrations/071_create_station_logbook_table.php new file mode 100644 index 00000000..762ef81b --- /dev/null +++ b/application/migrations/071_create_station_logbook_table.php @@ -0,0 +1,52 @@ +dbforge->add_field(array( + 'logbook_id' => array( + 'type' => 'BIGINT', + 'constraint' => 20, + 'unsigned' => TRUE, + 'auto_increment' => TRUE, + 'unique' => TRUE + ), + + 'user_id' => array( + 'type' => 'BIGINT', + 'constraint' => 20, + 'unsigned' => TRUE, + 'auto_increment' => FALSE + ), + + 'logbook_name' => array( + 'type' => 'VARCHAR', + 'constraint' => '191', + 'null' => TRUE + ), + + 'modified' => array( + 'type' => 'timestamp', + 'null' => TRUE, + ) + )); + + $this->dbforge->add_key('logbook_id', TRUE); + $this->dbforge->add_key('user_id', TRUE); + + $this->dbforge->create_table('station_logbooks'); + } + + public function down() + { + $this->dbforge->drop_table('station_logbooks'); + } +} \ No newline at end of file