Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function run()
 {
     $this->progress($this->count / ($this->count + count($this->tables)) * 100);
     $table = $this->tables[0];
     if (!isset($this->db->{$table})) {
         $this->status(tr('Creating table "%1"...', $table));
         $this->db->createTable($this->schema->getSchema($table));
     }
     array_shift($this->tables);
     $this->count++;
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function setSchema(DatabaseSchema $schema)
 {
     $this->schema = $schema;
     foreach ($schema->getTables() as $table) {
         $tableSchema = $schema->getSchema($table);
         if (!in_array($table, $this->tableNames)) {
             $this->tableNames[] = $table;
             $this->tables[$table] = $this->getTable($table);
         }
         $this->{$table}->setSchema($tableSchema);
     }
 }