<?php

class m150312_091004_create_gate_sets_tables extends MyDbMigration
{
  public function up()
  {
    $this->createTableIfNotExists('gate_set');
    $this->addColumn('gate_set', 'name', 'string NOT NULL');
    $this->addColumn('gate_set', 'description', 'string');

    $this->createTableIfNotExists('gate_set_matrix');
    $this->addColumn('gate_set_matrix', 'gate', 'int NOT NULL');
    $this->addColumn('gate_set_matrix', 'set', 'int NOT NULL');
  }

  public function down()
  {
    $this->dropTable('gate_set_matrix');
    $this->dropTable('gate_set');
    return true;
  }
}
