Exemplo n.º 1
0
 /**
  * Run repair step.
  * Must throw exception on error.
  *
  * @throws \Exception in case of failure
  */
 public function run()
 {
     foreach ($this->oldDatabaseTables() as $tableName) {
         if ($this->connection->tableExists($tableName)) {
             $this->emit('\\OC\\Repair', 'info', [sprintf('Table %s has been deleted', $tableName)]);
             $this->connection->dropTable($tableName);
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Run repair step.
  * Must throw exception on error.
  *
  * @throws \Exception in case of failure
  */
 public function run(IOutput $output)
 {
     $tables = $this->oldDatabaseTables();
     $output->startProgress(count($tables));
     foreach ($this->oldDatabaseTables() as $tableName) {
         if ($this->connection->tableExists($tableName)) {
             $this->connection->dropTable($tableName);
         }
         $output->advance(1, "Drop old database table: {$tableName}");
     }
     $output->finishProgress();
 }
Exemplo n.º 3
0
 /**
  * @depends testTableExists
  */
 public function testDropTable()
 {
     $this->makeTestTable();
     $this->assertTableExist('table');
     $this->connection->dropTable('table');
     $this->assertTableNotExist('table');
 }
Exemplo n.º 4
0
 public function testSetValuesOverWritePrecondition()
 {
     $this->makeTestTable();
     $this->connection->setValues('table', ['integerfield' => 1], ['textfield' => 'foo', 'booleanfield' => true, 'clobfield' => 'not_null']);
     $this->connection->setValues('table', ['integerfield' => 1], ['textfield' => 'bar'], ['booleanfield' => true]);
     $this->assertEquals('bar', $this->getTextValueByIntergerField(1));
     $this->connection->dropTable('table');
 }
Exemplo n.º 5
0
 /**
  * Drop a table from the database if it exists
  *
  * @param string $table table name without the prefix
  */
 public function dropTable($table)
 {
     $this->connection->dropTable($table);
 }
Exemplo n.º 6
0
 public function tearDown()
 {
     $this->db->dropTable('contacts_addressbooks');
     $this->db->dropTable('contacts_cards');
     parent::tearDown();
 }
Exemplo n.º 7
0
 public function tearDown()
 {
     $this->db->dropTable('clndr_calendars');
     $this->db->dropTable('clndr_objects');
     parent::tearDown();
 }