CC-3605 : Create 2.1 upgrades

This commit is contained in:
Naomi Aro 2012-04-11 11:18:28 +02:00
parent bc6e911673
commit cc806d9b7b
1 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,39 @@
<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
class Version20120411102907 extends AbstractMigration
{
/*
* changing many columns from time without timezone to interval
*
* altering cc_schedule for 2.1
*/
public function up(Schema $schema)
{
$this->_addSql("ALTER TABLE cc_files ALTER COLUMN length TYPE interval");
$this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cuein TYPE interval");
$this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cueout TYPE interval");
$this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cliplength TYPE interval");
$this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN cue_in TYPE interval");
$this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN cue_out TYPE interval");
$this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN clip_length TYPE interval");
//remove old columns from cc_schedule that deal with groups or playlists.
$this->_addSql("ALTER TABLE cc_schedule DROP COLUMN group_id");
$this->_addSql("ALTER TABLE cc_schedule DROP COLUMN schedule_group_played");
$this->_addSql("ALTER TABLE cc_schedule DROP COLUMN playlist_id");
$this->_addSql("ALTER TABLE cc_schedule ADD playout_status integer DEFAULT 1 NOT NULL");
}
public function down(Schema $schema)
{
}
}