From 266cd3f021f9b33179708d5064bf424d6b32e40f Mon Sep 17 00:00:00 2001 From: Corby Krick Date: Sun, 24 Feb 2013 17:58:36 -0600 Subject: [PATCH] Turning on migration, adding a migration to add lotw credentials to the database, and removing a sample migration. --- application/config/migration.php | 4 +-- .../migrations/001_Create_accounts.php | 32 ------------------- .../migrations/001_add_lotw_credentials.php | 21 ++++++++++++ 3 files changed, 23 insertions(+), 34 deletions(-) delete mode 100644 application/migrations/001_Create_accounts.php create mode 100644 application/migrations/001_add_lotw_credentials.php diff --git a/application/config/migration.php b/application/config/migration.php index 49d05306..038a90e9 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -8,7 +8,7 @@ | whenever you intend to do a schema migration. | */ -$config['migration_enabled'] = FALSE; +$config['migration_enabled'] = TRUE; /* @@ -21,7 +21,7 @@ $config['migration_enabled'] = FALSE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 0; +$config['migration_version'] = 1; /* diff --git a/application/migrations/001_Create_accounts.php b/application/migrations/001_Create_accounts.php deleted file mode 100644 index d4349941..00000000 --- a/application/migrations/001_Create_accounts.php +++ /dev/null @@ -1,32 +0,0 @@ -db->table_exists('accounts')) - { - // Setup Keys - $this->dbforge->add_key('id', TRUE); - - $this->dbforge->add_field(array( - 'id' => array('type' => 'INT', 'constraint' => 5, 'unsigned' => TRUE, 'auto_increment' => TRUE), - 'company_name' => array('type' => 'VARCHAR', 'constraint' => '200', 'null' => FALSE), - 'first_name' => array('type' => 'VARCHAR', 'constraint' => '200', 'null' => FALSE), - 'last_name' => array('type' => 'VARCHAR', 'constraint' => '200', 'null' => FALSE), - 'phone' => array('type' => 'TEXT', 'null' => FALSE), - 'email' => array('type' => 'TEXT', 'null' => FALSE), - 'address' => array('type' => 'TEXT', 'null' => FALSE), - 'Last_Update' => array('type' => 'DATETIME', 'null' => FALSE) - )); - - $this->dbforge->add_field("Created_At TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"); - $this->dbforge->create_table('accounts', TRUE); - } - } - - function down() - { - $this->dbforge->drop_table('accounts'); - } -} diff --git a/application/migrations/001_add_lotw_credentials.php b/application/migrations/001_add_lotw_credentials.php new file mode 100644 index 00000000..ab1608c5 --- /dev/null +++ b/application/migrations/001_add_lotw_credentials.php @@ -0,0 +1,21 @@ +dbforge->add_column('users', $fields); + } + + public function down() + { + $this->dbforge->drop_column('users', 'user_lotw_name'); + $this->dbforge->drop_column('users', 'user_lotw_password'); + } +} +?>