<?php

class m160713_100752_create_crossing_pairs_table extends MyDbMigration
{

  public function up()
  {
    $this->createTableIfNotExists ( 'crossing_pairs' );
    $this->addColumn ( 'crossing_pairs', 'pair', 'VARCHAR(256)' );
    $this->addColumn ( 'crossing_pairs', 'time_start', 'DATETIME NOT NULL' );
    $this->addColumn ( 'crossing_pairs', 'gate_start_id', 'BIGINT NOT NULL' );
    $this->addColumn ( 'crossing_pairs', 'time_end', 'DATETIME NOT NULL' );
    $this->addColumn ( 'crossing_pairs', 'gate_end_id', 'BIGINT NOT NULL' );
    $this->addColumn ( 'crossing_pairs', 'elapsed', 'REAL NOT NULL' );
    $this->addColumn ( 'crossing_pairs', 'section_id', 'BIGINT NOT NULL' );
    $this->addColumn ( 'crossing_pairs', 'speed', 'REAL NOT NULL' );
    $this->addColumn ( 'crossing_pairs', 'plate', 'VARCHAR(256)' );
  }

  public function down()
  {
    $this->dropTableIfExists ( 'crossing_pairs' );
    return true;
  }
}
    