I want update my trigger from live, and I want to know if I can use migrations for that because I tried 2 alternative in my migrations:
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$stmt = $this->connection->prepare(file_get_contents(__DIR__ . '/Version20150929103205/new_trigger_procedure.sql'));
$stmt->execute();
$this->addSql(file_get_contents(__DIR__ . '/Version20150929103205/new_trigger_procedure.sql'));
}
but not work. My sql file have multiple declaration. Is a possibility to run it with migrations?
Here is a model:
DROP TRIGGER IF EXISTS trigger_1;
Create Trigger trigger_1 BEFORE...
DROP Trigger IF EXISTS trigger_2;
Create Trigger trigger_2 Before ...
.
.
.
$this->connection->executeQuery($fileContents);?