Revert "Installation goes brrrr"
This commit is contained in:
parent
9db321cf11
commit
d36155620c
|
@ -124,11 +124,6 @@ class MigrationService {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->connection->tableExists('migrations')) {
|
|
||||||
$this->migrationTableCreated = true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$schema = new SchemaWrapper($this->connection);
|
$schema = new SchemaWrapper($this->connection);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -413,11 +408,6 @@ class MigrationService {
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function migrate($to = 'latest', $schemaOnly = false) {
|
public function migrate($to = 'latest', $schemaOnly = false) {
|
||||||
if ($schemaOnly) {
|
|
||||||
$this->migrateSchemaOnly($to);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// read known migrations
|
// read known migrations
|
||||||
$toBeExecuted = $this->getMigrationsToExecute($to);
|
$toBeExecuted = $this->getMigrationsToExecute($to);
|
||||||
foreach ($toBeExecuted as $version) {
|
foreach ($toBeExecuted as $version) {
|
||||||
|
@ -425,42 +415,6 @@ class MigrationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Applies all not yet applied versions up to $to
|
|
||||||
*
|
|
||||||
* @param string $to
|
|
||||||
* @throws \InvalidArgumentException
|
|
||||||
*/
|
|
||||||
public function migrateSchemaOnly($to = 'latest') {
|
|
||||||
// read known migrations
|
|
||||||
$toBeExecuted = $this->getMigrationsToExecute($to);
|
|
||||||
|
|
||||||
if (empty($toBeExecuted)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$toSchema = null;
|
|
||||||
foreach ($toBeExecuted as $version) {
|
|
||||||
$instance = $this->createInstance($version);
|
|
||||||
|
|
||||||
$toSchema = $instance->changeSchema($this->output, function () use ($toSchema) {
|
|
||||||
return $toSchema ?: new SchemaWrapper($this->connection);
|
|
||||||
}, ['tablePrefix' => $this->connection->getPrefix()]) ?: $toSchema;
|
|
||||||
|
|
||||||
$this->markAsExecuted($version);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($toSchema instanceof SchemaWrapper) {
|
|
||||||
$targetSchema = $toSchema->getWrappedSchema();
|
|
||||||
if ($this->checkOracle) {
|
|
||||||
$beforeSchema = $this->connection->createSchema();
|
|
||||||
$this->ensureOracleIdentifierLengthLimit($beforeSchema, $targetSchema, strlen($this->connection->getPrefix()));
|
|
||||||
}
|
|
||||||
$this->connection->migrateToSchema($targetSchema);
|
|
||||||
$toSchema->performDropTableCalls();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the human readable descriptions for the migration steps to run
|
* Get the human readable descriptions for the migration steps to run
|
||||||
*
|
*
|
||||||
|
|
|
@ -154,7 +154,7 @@ class Installer {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ms = new \OC\DB\MigrationService($info['id'], \OC::$server->getDatabaseConnection());
|
$ms = new \OC\DB\MigrationService($info['id'], \OC::$server->getDatabaseConnection());
|
||||||
$ms->migrate('latest', true);
|
$ms->migrate();
|
||||||
}
|
}
|
||||||
if ($previousVersion) {
|
if ($previousVersion) {
|
||||||
OC_App::executeRepairSteps($appId, $info['repair-steps']['post-migration']);
|
OC_App::executeRepairSteps($appId, $info['repair-steps']['post-migration']);
|
||||||
|
@ -589,7 +589,7 @@ class Installer {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ms = new \OC\DB\MigrationService($app, \OC::$server->getDatabaseConnection());
|
$ms = new \OC\DB\MigrationService($app, \OC::$server->getDatabaseConnection());
|
||||||
$ms->migrate('latest', true);
|
$ms->migrate();
|
||||||
}
|
}
|
||||||
|
|
||||||
//run appinfo/install.php
|
//run appinfo/install.php
|
||||||
|
|
|
@ -150,6 +150,6 @@ abstract class AbstractDatabase {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$ms = new MigrationService('core', \OC::$server->getDatabaseConnection());
|
$ms = new MigrationService('core', \OC::$server->getDatabaseConnection());
|
||||||
$ms->migrate('latest', true);
|
$ms->migrate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue