From 43c44bdd02b4da2aa22443d44606e11d2f323552 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 23 Nov 2023 14:19:10 +0000 Subject: [PATCH] [DXpedition] Create a dxpedition table Creates a dxpedition table this will be used to store upcoming dxpedition data from external sources. --- application/config/migration.php | 2 +- .../154_create_dxpedition_table.php | 59 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 application/migrations/154_create_dxpedition_table.php diff --git a/application/config/migration.php b/application/config/migration.php index 4a7774a3..98fd0f82 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 153; +$config['migration_version'] = 154; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/154_create_dxpedition_table.php b/application/migrations/154_create_dxpedition_table.php new file mode 100644 index 00000000..55974079 --- /dev/null +++ b/application/migrations/154_create_dxpedition_table.php @@ -0,0 +1,59 @@ +db->table_exists('dxpedition')) { + + $this->dbforge->add_field(array( + 'id' => array( + 'type' => 'INT', + 'constraint' => 6, + 'unsigned' => TRUE, + 'auto_increment' => TRUE + ), + 'start_date' => array( + 'type' => 'DATE', + 'null' => TRUE, + ), + 'end_date' => array( + 'type' => 'DATE', + 'null' => TRUE, + ), + 'callsign' => array( + 'type' => 'VARCHAR', + 'constraint' => '255', + 'null' => TRUE, + ), + 'country' => array( + 'type' => 'VARCHAR', + 'constraint' => '255', + 'null' => TRUE, + ), + 'notes' => array( + 'type' => 'VARCHAR', + 'constraint' => '255', + 'null' => TRUE, + ), + )); + $this->dbforge->add_key('id', TRUE); + $this->dbforge->add_key('callsign', TRUE); + + $this->dbforge->create_table('dxpedition'); + } + } + + public function down() + { + $this->dbforge->drop_table('dxpedition'); + } +}