aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/DB
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-06-28 17:08:46 +0200
committerRobin Appelman <robin@icewind.nl>2024-07-02 13:45:12 +0200
commit4f01486da0e6d2d67e0ec7fd8b9dd8bf9df6af67 (patch)
treef911bddf1884d234ed08d5b5977dd9450200148b /lib/private/DB
parent8ec53608b0b1f6fad1569933bc05b723bd2bd2fc (diff)
downloadnextcloud-server-4f01486da0e6d2d67e0ec7fd8b9dd8bf9df6af67.tar.gz
nextcloud-server-4f01486da0e6d2d67e0ec7fd8b9dd8bf9df6af67.zip
feat: add commands for exporting current and expected database schema
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/DB')
-rw-r--r--lib/private/DB/MigrationService.php2
-rw-r--r--lib/private/DB/SchemaWrapper.php8
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php
index 4b91b6f0996..19d1b240736 100644
--- a/lib/private/DB/MigrationService.php
+++ b/lib/private/DB/MigrationService.php
@@ -459,7 +459,7 @@ class MigrationService {
* @return IMigrationStep
* @throws \InvalidArgumentException
*/
- protected function createInstance($version) {
+ public function createInstance($version) {
$class = $this->getClass($version);
try {
$s = \OCP\Server::get($class);
diff --git a/lib/private/DB/SchemaWrapper.php b/lib/private/DB/SchemaWrapper.php
index 8ff952b8710..5720e10fbdb 100644
--- a/lib/private/DB/SchemaWrapper.php
+++ b/lib/private/DB/SchemaWrapper.php
@@ -20,9 +20,13 @@ class SchemaWrapper implements ISchemaWrapper {
/** @var array */
protected $tablesToDelete = [];
- public function __construct(Connection $connection) {
+ public function __construct(Connection $connection, ?Schema $schema = null) {
$this->connection = $connection;
- $this->schema = $this->connection->createSchema();
+ if ($schema) {
+ $this->schema = $schema;
+ } else {
+ $this->schema = $this->connection->createSchema();
+ }
}
public function getWrappedSchema() {