<?php

class m140718_092000_add_apikey_to_users extends MyDbMigration
{
  public function up()
  {
    if ($this->dbConnection->schema->getTable('users')->getColumn('apikey') == null)
      $this->addColumn('users', 'apikey', 'string UNIQUE');
  }

  public function down()
  {
    if ($this->dbConnection->schema->getTable('users')->getColumn('apikey') != null)
      $this->dropColumn('users', 'apikey');

    return true;
  }
}