Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/db/Event/499-AddPointColumn.php b/db/Event/499-AddPointColumn.php
- new file mode 100644
- index 0000000..eaa4272
- --- /dev/null
- +++ b/db/Event/499-AddPointColumn.php
- @@ -0,0 +1,24 @@
- +<?php
- +/**
- + * Add points column
- + * @author kshema
- + */
- +class Event_499 extends Migration
- +{
- + public function deploy()
- + {
- + if (!MyDB::getInstance()->columnExists($this->migrationObject->database, Sessions::TABLE, 'points')) {
- + $sql = "ALTER TABLE {$this->getTableName(Sessions::TABLE)} ADD COLUMN `points` smallint(1)";
- + $result = MyDB::getInstance()->execute($sql);
- + if (!$result) {
- + return false;
- + }
- + }
- + return true;
- + }
- +
- + public function getRollbackSQL()
- + {
- + return "ALTER TABLE {$this->getTableName(Sessions::TABLE)} DROP COLUMN `points`";
- + }
- +}
Add Comment
Please, Sign In to add comment