Пример #1
0
 /**
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     // Drop beer table
     $schema->dropTable('beers');
     // Drop messages table
     $schema->dropTable('messages');
 }
Пример #2
0
 /**
  * Down method
  *
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     if (Version::isSupportGetInstanceFunction()) {
         $app = Application::getInstance();
         $meta = $this->getMetadata($app['orm.em']);
         $tool = new SchemaTool($app['orm.em']);
         $schemaFromMetadata = $tool->getSchemaFromMetadata($meta);
         // テーブル削除
         foreach ($schemaFromMetadata->getTables() as $table) {
             if ($schema->hasTable($table->getName())) {
                 $schema->dropTable($table->getName());
             }
         }
         // シーケンス削除
         foreach ($schemaFromMetadata->getSequences() as $sequence) {
             if ($schema->hasSequence($sequence->getName())) {
                 $schema->dropSequence($sequence->getName());
             }
         }
     } else {
         if ($schema->hasTable(self::MAKER)) {
             $schema->dropTable(self::MAKER);
         }
         if ($schema->hasTable(self::PRODUCTMAKER)) {
             $schema->dropTable(self::PRODUCTMAKER);
         }
     }
     if ($this->connection->getDatabasePlatform()->getName() == 'postgresql') {
         foreach ($this->sequence as $sequence) {
             if ($schema->hasSequence($sequence)) {
                 $schema->dropSequence($sequence);
             }
         }
     }
 }
 /**
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     // this down() migration is auto-generated, please modify it to your needs
     $schema->dropTable('plg_maker_plugin');
     $schema->dropTable('plg_maker');
     $schema->dropTable('plg_product_maker');
 }
 /**
  * Remove data.
  *
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     if (Version::isSupportGetInstanceFunction()) {
         $app = Application::getInstance();
         $meta = $this->getMetadata($app['orm.em']);
         $tool = new SchemaTool($app['orm.em']);
         $schemaFromMetadata = $tool->getSchemaFromMetadata($meta);
         // テーブル削除
         foreach ($schemaFromMetadata->getTables() as $table) {
             if ($schema->hasTable($table->getName())) {
                 $schema->dropTable($table->getName());
             }
         }
         // シーケンス削除
         foreach ($schemaFromMetadata->getSequences() as $sequence) {
             if ($schema->hasSequence($sequence->getName())) {
                 $schema->dropSequence($sequence->getName());
             }
         }
     } else {
         // this down() migration is auto-generated, please modify it to your needs
         $schema->dropTable(self::NAME);
         $schema->dropSequence('plg_recommend_product_recommend_product_id_seq');
     }
 }
 /**
  * remove table.
  *
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     //current version >= 3.0.9
     if (Version::isSupportGetInstanceFunction()) {
         $app = Application::getInstance();
         $meta = $this->getMetadata($app['orm.em']);
         $tool = new SchemaTool($app['orm.em']);
         $schemaFromMetadata = $tool->getSchemaFromMetadata($meta);
         // テーブル削除
         foreach ($schemaFromMetadata->getTables() as $table) {
             if ($schema->hasTable($table->getName())) {
                 $schema->dropTable($table->getName());
             }
         }
         // シーケンス削除
         foreach ($schemaFromMetadata->getSequences() as $sequence) {
             if ($schema->hasSequence($sequence->getName())) {
                 $schema->dropSequence($sequence->getName());
             }
         }
         //for delete sequence in postgresql
         if ($this->connection->getDatabasePlatform()->getName() == 'postgresql') {
             $schema->dropSequence('plg_related_product_id_seq');
         }
     } else {
         // this down() migration is auto-generated, please modify it to your needs
         $schema->dropTable(self::NAME);
         $schema->dropSequence('plg_related_product_id_seq');
     }
 }
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $this->fillActivityTables($queries);
     $this->fillActivityListTables($queries);
     // Remove orocrm_magento_cart_emails
     $table = $schema->getTable('orocrm_magento_cart_emails');
     $table->removeForeignKey('FK_11B0F84B1AD5CDBF');
     $table->removeForeignKey('FK_11B0F84BA832C1C9');
     $schema->dropTable('orocrm_magento_cart_emails');
     // Remove orocrm_magento_cart_calls
     $table = $schema->getTable('orocrm_magento_cart_calls');
     $table->removeForeignKey('FK_83A847751AD5CDBF');
     $table->removeForeignKey('FK_83A8477550A89B2C');
     $schema->dropTable('orocrm_magento_cart_calls');
     // Remove orocrm_magento_order_emails
     $table = $schema->getTable('orocrm_magento_order_emails');
     $table->removeForeignKey('FK_10E2A9508D9F6D38');
     $table->removeForeignKey('FK_10E2A950A832C1C9');
     $schema->dropTable('orocrm_magento_order_emails');
     // Remove orocrm_magento_order_calls
     $table = $schema->getTable('orocrm_magento_order_calls');
     $table->removeForeignKey('FK_A885A3450A89B2C');
     $table->removeForeignKey('FK_A885A348D9F6D38');
     $schema->dropTable('orocrm_magento_order_calls');
 }
Пример #7
0
 public function down(Schema $schema)
 {
     $schema->dropTable('OAuthAuthCode');
     $schema->dropTable('OAuthAccessToken');
     $schema->dropTable('OAuthRefreshToken');
     $schema->dropTable('OAuthClient');
 }
Пример #8
0
 /**
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     $schema->dropTable('dict_topic');
     $schema->dropTable('dict_source');
     $schema->dropTable('dict_web');
     $schema->dropTable('dict_ro');
     $schema->dropTable('dict_queue');
 }
Пример #9
0
 /**
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     // this down() migration is auto-generated, please modify it to your needs
     $schema->dropTable('plg_coupon');
     $schema->dropSequence('plg_coupon_coupon_id_seq');
     $schema->dropTable('plg_coupon_detail');
     $schema->dropSequence('plg_coupon_detail_coupon_detail_id_seq');
     $schema->dropTable('plg_coupon_order');
     $schema->dropSequence('plg_coupon_order_id_seq');
 }
 /**
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     // this down() migration is auto-generated, please modify it to your needs
     $schema->dropTable('plg_mailmaga_plugin');
     // drop Sequence MailMagazine Plug-in
     $schema->dropTable('plg_mailmaga_template');
     $schema->dropTable('plg_send_history');
     $schema->dropTable('plg_send_customer');
     // drop sequence.
     $schema->dropSequence('plg_mailmaga_template_template_id_seq');
     $schema->dropSequence('plg_send_history_send_id_seq');
 }
Пример #11
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $this->fillActivityTables($queries);
     $this->fillActivityListTables($queries);
     // Remove orocrm_contactus_req_emails
     $table = $schema->getTable('orocrm_contactus_req_emails');
     $table->removeForeignKey('FK_E494F7AE427EB8A5');
     $table->removeForeignKey('FK_E494F7AEA832C1C9');
     $schema->dropTable('orocrm_contactus_req_emails');
     // Remove orocrm_contactus_request_calls
     $table = $schema->getTable('orocrm_contactus_request_calls');
     $table->removeForeignKey('FK_6F7A50CE427EB8A5');
     $table->removeForeignKey('FK_6F7A50CE50A89B2C');
     $schema->dropTable('orocrm_contactus_request_calls');
 }
Пример #12
0
 /**
  * @param Schema $schema
  */
 protected function oroCrmCreateTaskTable(Schema $schema)
 {
     if ($schema->hasTable($this->taskTableName)) {
         $schema->dropTable($this->taskTableName);
     }
     $table = $schema->createTable($this->taskTableName);
     $table->addColumn('id', 'integer', ['autoincrement' => true]);
     $table->addColumn('subject', 'string', ['notnull' => false, 'length' => 255]);
     $table->addColumn('description', 'string', ['notnull' => false, 'length' => 255]);
     $table->addColumn('due_date', 'datetime');
     $table->addColumn('task_priority_name', 'string', ['notnull' => false, 'length' => 32]);
     $table->addColumn('owner_id', 'integer', ['notnull' => false]);
     $table->addColumn('related_account_id', 'integer', ['notnull' => false]);
     $table->addColumn('related_contact_id', 'integer', ['notnull' => false]);
     $table->addColumn('reporter_id', 'integer', ['notnull' => false]);
     $table->addColumn('workflow_item_id', 'integer', ['notnull' => false]);
     $table->addColumn('workflow_step_id', 'integer', ['notnull' => false]);
     $table->addColumn('createdAt', 'datetime');
     $table->addColumn('updatedAt', 'datetime', ['notnull' => false]);
     $table->setPrimaryKey(['id']);
     $table->addIndex(['task_priority_name'], 'IDX_814DEE3FD34C1E8E', []);
     $table->addIndex(['owner_id'], 'IDX_814DEE3F7E3C61F9', []);
     $table->addIndex(['related_account_id'], 'IDX_814DEE3FE774F01D', []);
     $table->addIndex(['related_contact_id'], 'IDX_814DEE3FD6204081', []);
     $table->addIndex(['reporter_id'], 'IDX_814DEE3FE1CFE6F5', []);
     $table->addIndex(['due_date'], 'task_due_date_idx');
     $table->addUniqueIndex(['workflow_item_id'], 'UNIQ_814DEE3F1023C4EE');
     $table->addIndex(['workflow_step_id'], 'IDX_814DEE3F71FE882C', []);
     $this->oroCrmCreateTaskTableForeignKeys($schema);
 }
 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
     //start cc_show modifications
     $show_table = $schema->getTable('cc_show');
     $show_table->dropColumn('url');
     //end cc_show modifications
     //start cc_schedule modifications
     $schedule_table = $schema->getTable('cc_schedule');
     $playlist_id_col = $schedule_table->getColumn('playlist_id');
     $playlist_id_col->setNotnull(true);
     //end cc_schedule modifications
     //drop cc_show_rebroadcast table
     $schema->dropTable('cc_show_rebroadcast');
     //end drop cc_show_rebroadcast table
 }
 /**
  * Attributes table was not used in the code anymore so can be removed
  *
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     $prefixedTableName = $this->getTablePrefix() . 'attribute';
     if ($schema->hasTable($prefixedTableName)) {
         $schema->dropTable($prefixedTableName);
     }
 }
 public function down(Schema $schema)
 {
     $tables = ['module', 'module_admin', 'user', 'user_provider'];
     foreach ($tables as $table) {
         $schema->dropTable($table);
     }
 }
Пример #16
0
 /**
  * @param Schema $schema
  *
  * @throws \Doctrine\DBAL\Schema\SchemaException
  */
 public static function execute(Schema $schema)
 {
     $schema->dropTable('oro_email_to_folder');
     $emailTable = $schema->getTable('oro_email');
     $emailTable->dropColumn('is_seen');
     $emailTable->dropColumn('received');
 }
Пример #17
0
 public function up(\Doctrine\DBAL\Schema\Schema $schema)
 {
     // Drop table: display_pages
     $schema->dropTable('display_pages');
     // Alter table: displays
     $table = $schema->getTable('displays');
     $table->dropColumn('attributes');
     $table->dropColumn('isfirstnamedislayed');
     $table->dropColumn('islastnamedislayed');
     $table->dropColumn('isemaildislayed');
     $table->dropColumn('iscreatedatdislayed');
     $table->dropColumn('isupdatedatdislayed');
     $table->dropColumn('islastlogindislayed');
     $table->dropColumn('ispercentcompletedislayed');
     $table->dropColumn('ishaspaiddislayed');
     // Alter table: display_elements
     $table = $schema->getTable('display_elements');
     $table->addColumn('type', 'string', array('length' => 255));
     $table->addColumn('title', 'string', array('length' => 255));
     $table->addColumn('name', 'string', array('length' => 255, 'notNull' => false));
     $table->addColumn('weight', 'integer', array());
     $table->dropColumn('attributes');
     $table->dropColumn('page_id');
     $table->addColumn('display_id', 'bigint', array('precision' => 10, 'notNull' => false));
     $table->addIndex(array('display_id'), 'IDX_23A0A27351A2DF33');
     $table->dropIndex('idx_23a0a273c4663e4');
     $table->addForeignKeyConstraint('displays', array('display_id'), array('id'), array('onDelete' => 'CASCADE'), 'FK_23A0A27351A2DF33');
 }
Пример #18
0
 /**
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     // this down() migration is auto-generated, please modify it to your needs
     $calendarobjects = $schema->getTable('calendarobjects');
     $calendarobjects->removeColumn('uid');
     $schema->dropTable('schedulingobjects');
 }
Пример #19
0
 /**
  * {@inheritdoc}
  */
 public function up(Schema $schema, QueryBag $queries)
 {
     $schema->dropTable('oro_calendar_connection');
     $calendarConnectionClass = 'Oro\\Bundle\\CalendarBundle\\Entity\\CalendarConnection';
     $queries->addPostQuery(new ParametrizedSqlMigrationQuery('DELETE FROM oro_entity_config_field WHERE entity_id IN (' . 'SELECT id FROM oro_entity_config WHERE class_name = :class)', ['class' => $calendarConnectionClass], ['class' => 'string']));
     $queries->addPostQuery(new ParametrizedSqlMigrationQuery('DELETE FROM oro_entity_config WHERE class_name = :class', ['class' => $calendarConnectionClass], ['class' => 'string']));
     $queries->addPostQuery(new DeleteAclMigrationQuery($this->container, new ObjectIdentity('entity', $calendarConnectionClass)));
 }
 /**
  * Defines all the tables in the schema
  * 
  * @param Schema $schema  Database schema
  * @param string $version Table version
  */
 protected function defineTables(Schema $schema, $version)
 {
     // Load all table definitions
     foreach ($this->getTableDefinitions() as $tableDefinition) {
         // Drop all tables
         if ($schema->hasTable($tableDefinition->getName())) {
             $schema->dropTable($tableDefinition->getName());
         }
         // Only create the table if it exists in this version of the schema
         $table = $schema->createTable($tableDefinition->getName());
         $tableDefinition->define($table, $version);
         // If the table has no columns, drop it
         if (count($table->getColumns()) < 1) {
             $schema->dropTable($tableDefinition->getName());
         }
     }
 }
 /**
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     // this down() migration is auto-generated, please modify it to your needs
     if (!$schema->hasTable(self::NAME)) {
         return true;
     }
     $schema->dropTable(self::NAME);
 }
Пример #22
0
 public function testDropTable()
 {
     $tableName = "foo";
     $table = new Table($tableName);
     $schema = new Schema(array($table));
     $this->assertTrue($schema->hasTable("foo"));
     $schema->dropTable("foo");
     $this->assertFalse($schema->hasTable("foo"));
 }
Пример #23
0
 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     $tablesToDrop = array("LastNotification", "Event", "Session", "PrintingJobConfiguration", "PrintingJob");
     foreach ($tablesToDrop as $table) {
         if ($schema->hasTable($table)) {
             $schema->dropTable($table);
         }
     }
 }
Пример #24
0
 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     $tablesToDrop = ['LastNotification', 'Event', 'Session', 'PrintingJobConfiguration', 'PrintingJob'];
     foreach ($tablesToDrop as $table) {
         if ($schema->hasTable($table)) {
             $schema->dropTable($table);
         }
     }
 }
Пример #25
0
 /**
  * @param Schema $schema
  **/
 public function down(Schema $schema)
 {
     $app = new \Eccube\Application();
     // this down() migration is auto-generated, please modify it to your needs
     $schema->dropTable('plg_holiday_plugin');
     $schema->dropTable('plg_holiday');
     $schema->dropTable('plg_holiday_week');
     $schema->dropTable('plg_holiday_config');
     /* ブロックの削除 */
     $block_position_delete = "DELETE FROM dtb_block_position WHERE block_id = (SELECT block_id FROM dtb_block WHERE file_name = 'pg_calendar')";
     $this->connection->executeUpdate($block_position_delete);
     $block_delete = "DELETE FROM dtb_block WHERE file_name = 'pg_calendar'";
     $this->connection->executeUpdate($block_delete);
     /* ブロックファイルとCSSファイルの削除 */
     $pg_calendar_filename = $app['config']['template_realdir'] . "/Block/pg_calendar.twig";
     @unlink($pg_calendar_filename);
     $pg_calendar_css_filename = $app['config']['template_html_realdir'] . "/css/pg_calendar.css";
     @unlink($pg_calendar_css_filename);
 }
 /**
  * Down method.
  *
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     if (Version::isSupportMethod()) {
         $app = Application::getInstance();
         $meta = $this->getMetadata($app['orm.em']);
         $tool = new SchemaTool($app['orm.em']);
         $schemaFromMetadata = $tool->getSchemaFromMetadata($meta);
         // テーブル削除
         foreach ($schemaFromMetadata->getTables() as $table) {
             if ($schema->hasTable($table->getName())) {
                 $schema->dropTable($table->getName());
             }
         }
     } else {
         if ($schema->hasTable(self::TABLE)) {
             $schema->dropTable(self::TABLE);
         }
     }
 }
Пример #27
0
 public function down(\Doctrine\DBAL\Schema\Schema $schema)
 {
     // Drop table: files
     $schema->dropTable('files');
     // Alter table: attachments
     $table = $schema->getTable('attachments');
     $table->addColumn('attachment', 'text', array('precision' => 10, 'comment' => ''));
     $table->addColumn('thumbnail', 'text', array('precision' => 10, 'notNull' => false, 'comment' => ''));
     $table->dropColumn('attachmenthash');
     $table->dropColumn('thumbnailhash');
 }
Пример #28
0
 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     // this up() migration is auto-generated, please modify it to your needs
     $this->addSql("alter table plg_coupon_order add user_id integer");
     $this->addSql("alter table plg_coupon_order add email text");
     $this->addSql("alter table plg_coupon_order add discount  decimal not null default 0");
     $this->addSql("alter table plg_coupon add coupon_use_time integer");
     if ($schema->hasTable('plg_coupon_plugin')) {
         $schema->dropTable('plg_coupon_plugin');
         $schema->dropSequence('plg_coupon_plugin_plugin_id_seq');
     }
 }
Пример #29
0
 public function down(Schema $schema)
 {
     // Bisherige Ticket-Tabelle entfernen
     $schema->dropTable('ticket');
     // Neue Ticket-Tabelle erstellen
     $ticketTable = $schema->createTable('ticket');
     $ticketTable->addcolumn('id', 'integer')->setNotnull(true);
     $ticketTable->addcolumn('websiteid', 'string', array('length' => 100))->setNotnull(true);
     $ticketTable->addcolumn('timestamp', 'integer', array('length' => 100))->setNotnull(true);
     $ticketTable->addcolumn('url', 'string', array('length' => 255))->setNotnull(true);
     $ticketTable->setPrimaryKey(array('id', 'websiteid'));
     $this->addSql('TRUNCATE TABLE ticket');
 }
Пример #30
0
 /**
  * Drop all tables
  *
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     $schema->dropTable('price');
     $schema->dropTable('product');
     $schema->dropTable('payment');
     $schema->dropTable('costumer');
     $schema->dropTable('order');
     $schema->dropTable('order_product');
 }