CC-3684 : Upgraded database not equivalent to fresh install database part 2
This commit is contained in:
parent
53a85204da
commit
119b39be11
|
@ -18,11 +18,7 @@ class Version20120405114454 extends AbstractMigration
|
|||
$cc_subjs_token->addColumn('token', 'string', array('length' => 40, 'notnull' => 1));
|
||||
$cc_subjs_token->addColumn('created', 'datetime', array('notnull' => 1));
|
||||
|
||||
$cc_subjs_token->setPrimaryKey(array('id'));
|
||||
|
||||
$cc_subjs = $schema->getTable('cc_subjs');
|
||||
$cc_subjs_token->addNamedForeignKeyConstraint('cc_subjs_token_userid_fkey', $cc_subjs, array('user_id'), array('id'));
|
||||
$cc_subjs_token->addUniqueIndex(array('token'), 'uniq_token');
|
||||
$cc_subjs_token->setPrimaryKey(array('id'));
|
||||
//end create cc_subjs_token table
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,14 @@ class Version20120410104441 extends AbstractMigration
|
|||
*/
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->_addSql("DROP TRIGGER calculate_position ON cc_playlistcontents");
|
||||
$this->_addSql("DROP FUNCTION calculate_position()");
|
||||
|
||||
$this->_addSql("ALTER TABLE cc_subjs_token ALTER COLUMN created TYPE timestamp");
|
||||
|
||||
$this->_addSql("ALTER TABLE cc_subjs_token ADD CONSTRAINT cc_subjs_token_idx UNIQUE (token);");
|
||||
$this->_addSql("ALTER TABLE cc_subjs_token ADD CONSTRAINT cc_subjs_token_userid_fkey FOREIGN KEY (user_id) REFERENCES cc_subjs(id) ON DELETE CASCADE");
|
||||
|
||||
//add temp columns for changing bitrate and sample rate to integers.
|
||||
$this->_addSql("ALTER TABLE cc_files ADD temp_br integer");
|
||||
$this->_addSql("ALTER TABLE cc_files ADD temp_sr integer");
|
||||
|
@ -26,8 +34,8 @@ class Version20120410104441 extends AbstractMigration
|
|||
$this->_addSql("ALTER TABLE cc_files RENAME COLUMN temp_br TO bit_rate");
|
||||
|
||||
//add utime, lptime
|
||||
$this->_addSql("ALTER TABLE cc_files ADD utime timestamp(6)");
|
||||
$this->_addSql("ALTER TABLE cc_files ADD lptime timestamp(6)");
|
||||
$this->_addSql("ALTER TABLE cc_files ADD utime timestamp");
|
||||
$this->_addSql("ALTER TABLE cc_files ADD lptime timestamp");
|
||||
|
||||
//setting these to a default now for timeline refresh purposes.
|
||||
$now = gmdate("Y-m-d H:i:s");
|
||||
|
|
|
@ -19,7 +19,7 @@ class Version20120410143340 extends AbstractMigration
|
|||
|
||||
$this->_addSql("ALTER TABLE cc_playlist ADD CONSTRAINT cc_playlist_createdby_fkey FOREIGN KEY (creator_id) REFERENCES cc_subjs(id) NOT DEFERRABLE INITIALLY IMMEDIATE");
|
||||
|
||||
$this->_addSql("ALTER TABLE cc_playlist ADD utime timestamp(6)");
|
||||
$this->_addSql("ALTER TABLE cc_playlist ADD utime timestamp");
|
||||
//set the initial created to modified time since this is the closest we can get to inital creation time.
|
||||
$this->_addSql("UPDATE cc_playlist SET utime = mtime");
|
||||
|
||||
|
|
|
@ -14,24 +14,27 @@ class Version20120411102907 extends AbstractMigration
|
|||
*/
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->_addSql("ALTER TABLE cc_files ALTER COLUMN length TYPE interval");
|
||||
$this->_addSql("ALTER TABLE cc_files ALTER COLUMN length TYPE interval DEFAULT '00:00:00'");
|
||||
$this->_addSql("ALTER TABLE cc_files ALTER COLUMN file_exists DROP NOT NULL");
|
||||
|
||||
$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_playlistcontents ALTER COLUMN cuein TYPE interval DEFAULT '00:00:00'");
|
||||
$this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cueout TYPE interval DEFAULT '00:00:00'");
|
||||
$this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cliplength TYPE interval DEFAULT '00:00:00'");
|
||||
|
||||
$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");
|
||||
$this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN cue_in TYPE interval DEFAULT '00:00:00'");
|
||||
$this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN cue_out TYPE interval DEFAULT '00:00:00'");
|
||||
$this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN clip_length TYPE interval DEFAULT '00:00:00'");
|
||||
|
||||
$this->_addSql("ALTER TABLE cc_show_instances ALTER COLUMN time_filled TYPE interval");
|
||||
$this->_addSql("ALTER TABLE cc_show_instances ALTER COLUMN time_filled TYPE interval DEFAULT '00:00:00'");
|
||||
|
||||
//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");
|
||||
$this->_addSql("ALTER TABLE cc_schedule ADD playout_status smallint DEFAULT 1 NOT NULL");
|
||||
|
||||
$this->_addSql("ALTER TABLE cc_music_dirs ALTER COLUMN exists DROP NOT NULL, ALTER COLUMN watched DROP NOT NULL");
|
||||
}
|
||||
|
||||
public function down(Schema $schema)
|
||||
|
|
|
@ -12,8 +12,8 @@ class Version20120411174904 extends AbstractMigration
|
|||
*/
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->_addSql("ALTER TABLE cc_show_instances ADD created timestamp(6)");
|
||||
$this->_addSql("ALTER TABLE cc_show_instances ADD last_scheduled timestamp(6)");
|
||||
$this->_addSql("ALTER TABLE cc_show_instances ADD created timestamp");
|
||||
$this->_addSql("ALTER TABLE cc_show_instances ALTER COLUMN created SET NOT NULL");
|
||||
|
||||
//setting these to a default now for timeline refresh purposes.
|
||||
$now = gmdate("Y-m-d H:i:s");
|
||||
|
|
Loading…
Reference in New Issue