kopia lustrzana https://github.com/magicbug/Cloudlog
[Migration] Creates table station_logbook_relationship table for many to many setup
rodzic
c05d8f8fe0
commit
e254753bec
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
|||
| be upgraded / downgraded to.
|
||||
|
|
||||
*/
|
||||
$config['migration_version'] = 71;
|
||||
$config['migration_version'] = 72;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
* This migration creates a table called options which will hold global options needed within cloudlog
|
||||
* removing the need for lots of configuration files.
|
||||
*/
|
||||
|
||||
class Migration_create_station_logbook_relationship_table extends CI_Migration {
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->dbforge->add_field(array(
|
||||
'logbook_relation_id' => array(
|
||||
'type' => 'BIGINT',
|
||||
'constraint' => 20,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => TRUE,
|
||||
'unique' => TRUE
|
||||
),
|
||||
|
||||
'station_logbook_id' => array(
|
||||
'type' => 'BIGINT',
|
||||
'constraint' => 20,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => FALSE
|
||||
),
|
||||
|
||||
'station_location_id' => array(
|
||||
'type' => 'BIGINT',
|
||||
'constraint' => 20,
|
||||
'unsigned' => TRUE,
|
||||
'auto_increment' => FALSE
|
||||
),
|
||||
|
||||
'modified' => array(
|
||||
'type' => 'timestamp',
|
||||
'null' => TRUE,
|
||||
)
|
||||
));
|
||||
|
||||
$this->dbforge->add_key('logbook_relation_id', TRUE);
|
||||
$this->dbforge->add_key('station_logbook_id', TRUE);
|
||||
$this->dbforge->add_key('station_location_id', TRUE);
|
||||
|
||||
$this->dbforge->create_table('station_logbooks_relationship');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dbforge->drop_table('station_logbooks_relationship');
|
||||
}
|
||||
}
|
Ładowanie…
Reference in New Issue