CC-2135 : Doctrine Migration scripts missing
creating script for all 1.7 database modifications.
This commit is contained in:
parent
7cedbabb39
commit
b779e96391
|
@ -152,7 +152,7 @@
|
||||||
<column name="repeat_type" phpName="DbRepeatType" type="TINYINT" required="true"/>
|
<column name="repeat_type" phpName="DbRepeatType" type="TINYINT" required="true"/>
|
||||||
<column name="next_pop_date" phpName="DbNextPopDate" type="DATE" required="false"/>
|
<column name="next_pop_date" phpName="DbNextPopDate" type="DATE" required="false"/>
|
||||||
<column name="show_id" phpName="DbShowId" type="INTEGER" required="true"/>
|
<column name="show_id" phpName="DbShowId" type="INTEGER" required="true"/>
|
||||||
<column name="record" phpName="DbRecord" type="TINYINT" required="false"/>
|
<column name="record" phpName="DbRecord" type="TINYINT" required="false" defaultValue="0"/>
|
||||||
<foreign-key foreignTable="cc_show" name="cc_show_fkey" onDelete="CASCADE">
|
<foreign-key foreignTable="cc_show" name="cc_show_fkey" onDelete="CASCADE">
|
||||||
<reference local="show_id" foreign="id"/>
|
<reference local="show_id" foreign="id"/>
|
||||||
</foreign-key>
|
</foreign-key>
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration,
|
|
||||||
Doctrine\DBAL\Schema\Schema;
|
|
||||||
|
|
||||||
class Version20110308003959 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function up(Schema $schema)
|
|
||||||
{
|
|
||||||
$table = $schema->getTable("cc_show_instances");
|
|
||||||
$table->addColumn("record", "boolean", array( 'notnull' => 0, 'default' => 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema)
|
|
||||||
{
|
|
||||||
$table = $schema->getTable("cc_show_instances");
|
|
||||||
$table->dropColumn("record");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Migrations\AbstractMigration,
|
||||||
|
Doctrine\DBAL\Schema\Schema,
|
||||||
|
Doctrine\DBAL\Schema\Column,
|
||||||
|
Doctrine\DBAL\Types\Type;
|
||||||
|
|
||||||
|
class Version20110331111708 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function up(Schema $schema)
|
||||||
|
{
|
||||||
|
//start cc_show_instances modifications
|
||||||
|
$show_instances_table = $schema->getTable("cc_show_instances");
|
||||||
|
|
||||||
|
$show_instances_table->addColumn('record', 'smallint', array( 'notnull' => 0, 'default' => 0));
|
||||||
|
$show_instances_table->addColumn('rebroadcast', 'smallint', array( 'notnull' => 0, 'default' => 0));
|
||||||
|
$show_instances_table->addColumn('instance_id', 'integer', array( 'notnull' => 0));
|
||||||
|
$show_instances_table->addColumn('file_id', 'integer', array( 'notnull' => 0));
|
||||||
|
$show_instances_table->addColumn('soundcloud_id', 'integer', array( 'notnull' => 0));
|
||||||
|
|
||||||
|
$show_instances_table->addNamedForeignKeyConstraint("cc_original_show_instance_fkey", $show_instances_table, array("instance_id"), array("id"), array("onDelete" => "CASCADE"));
|
||||||
|
|
||||||
|
$files_table = $schema->getTable("cc_files");
|
||||||
|
$show_instances_table->addNamedForeignKeyConstraint("cc_recorded_file_fkey", $files_table, array("file_id"), array("id"), array("onDelete" => "CASCADE"));
|
||||||
|
//end cc_show_instances modifications
|
||||||
|
|
||||||
|
//start cc_show_days modifications
|
||||||
|
$show_days_table = $schema->getTable("cc_show_days");
|
||||||
|
|
||||||
|
$show_days_table->addColumn('record', 'smallint', array( 'notnull' => 0, 'default' => 0));
|
||||||
|
//end cc_show_days modifications
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema)
|
||||||
|
{
|
||||||
|
//start cc_show_instances modifications
|
||||||
|
$show_instances_table = $schema->getTable("cc_show_instances");
|
||||||
|
|
||||||
|
$show_instances_table->dropColumn("record");
|
||||||
|
$show_instances_table->dropColumn("rebroadcast");
|
||||||
|
$show_instances_table->dropColumn("instance_id");
|
||||||
|
$show_instances_table->dropColumn("file_id");
|
||||||
|
$show_instances_table->dropColumn("soundcloud_id");
|
||||||
|
//end cc_show_instances modifications
|
||||||
|
|
||||||
|
//start cc_show_days modifications
|
||||||
|
$show_days_table = $schema->getTable("cc_show_days");
|
||||||
|
|
||||||
|
$show_days_table->dropColumn("record");
|
||||||
|
//end cc_show_days modifications
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue