Skip to content

Instantly share code, notes, and snippets.

@shanestillwell
Created August 2, 2013 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shanestillwell/6143272 to your computer and use it in GitHub Desktop.
Save shanestillwell/6143272 to your computer and use it in GitHub Desktop.
<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
/**
* Add comments and collection_method to metricdata
*/
class Version201308021451400 extends AbstractMigration
{
public function up(Schema $schema)
{
$sql =<<<EOF
ALTER TABLE `metricdata`
ADD `comments` VARCHAR(255) NULL AFTER `value`,
ADD `collection_method` VARCHAR(255) NULL AFTER `comments`;
EOF;
$this->addSql($sql);
}
public function down(Schema $schema)
{
$sql =<<<EOF
ALTER TABLE `metricdata`
DROP `comments`,
DROP `collection_method`;
EOF;
$this->addSql($sql);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment