<?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration,
    Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your need!
 */
class Version20121107231047 extends AbstractMigration
{
    public function up(Schema $schema)
    {
        // this up() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

        $this->addSql("ALTER TABLE team ADD ownerId INT DEFAULT NULL, DROP owner");
        $this->addSql("ALTER TABLE `team`
  ADD CONSTRAINT `FK_C4E0A61FE05EFD25`
  FOREIGN KEY (`ownerId` )
  REFERENCES ``user` (`userId` );
");
        $this->addSql("CREATE INDEX IDX_C4E0A61FE05EFD25 ON team (ownerId)");
    }

    public function down(Schema $schema)
    {
        // this down() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

        $this->addSql("ALTER TABLE team DROP FOREIGN KEY FK_C4E0A61FE05EFD25");
        $this->addSql("DROP INDEX IDX_C4E0A61FE05EFD25 ON team");
        $this->addSql("ALTER TABLE team ADD owner INT NOT NULL, DROP ownerId");
    }
}

<?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration,
    Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your need!
 */
class Version20121107231047 extends AbstractMigration
{
    public function up(Schema $schema)
    {
        // this up() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

        $this->addSql("ALTER TABLE team ADD ownerId INT DEFAULT NULL, DROP owner");
        $this->addSql("ALTER TABLE `team`
  ADD CONSTRAINT `FK_C4E0A61FE05EFD25`
  FOREIGN KEY (`ownerId` )
  REFERENCES `user` (`userId` );
");
        $this->addSql("CREATE INDEX IDX_C4E0A61FE05EFD25 ON team (ownerId)");
    }

    public function down(Schema $schema)
    {
        // this down() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

        $this->addSql("ALTER TABLE team DROP FOREIGN KEY FK_C4E0A61FE05EFD25");
        $this->addSql("DROP INDEX IDX_C4E0A61FE05EFD25 ON team");
        $this->addSql("ALTER TABLE team ADD owner INT NOT NULL, DROP ownerId");
    }
}

Fix sql error in migration
Fix sql error in migration