]> source.dussan.org Git - nextcloud-server.git/commitdiff
feat(migrations): add metadata to existing migrations
authorMaxence Lange <maxence@artificial-owl.com>
Fri, 2 Aug 2024 02:22:44 +0000 (01:22 -0100)
committerMaxence Lange <maxence@artificial-owl.com>
Fri, 2 Aug 2024 19:26:12 +0000 (18:26 -0100)
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
apps/dav/lib/Migration/Version1031Date20240610134258.php
apps/files_trashbin/lib/Migration/Version1020Date20240403003535.php
core/Migrations/Version30000Date20240429122720.php
core/Migrations/Version30000Date20240708160048.php
core/Migrations/Version30000Date20240717111406.php

index 4e5e2218c41f99cd3597ce443b68bd53653d1376..cf288dfac6980d68c639e24e40aff3b024bad55c 100644 (file)
@@ -12,9 +12,13 @@ namespace OCA\DAV\Migration;
 use Closure;
 use OCP\DB\ISchemaWrapper;
 use OCP\DB\Types;
+use OCP\Migration\Attributes\AddColumn;
+use OCP\Migration\Attributes\ColumnType;
 use OCP\Migration\IOutput;
 use OCP\Migration\SimpleMigrationStep;
 
+#[AddColumn(table: 'dav_absence', name: 'dav_absence', type: ColumnType::STRING)]
+#[AddColumn(table: 'dav_absence', name: 'replacement_user_display_name', type:  ColumnType::STRING)]
 class Version1031Date20240610134258 extends SimpleMigrationStep {
        public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
                /** @var ISchemaWrapper $schema */
@@ -23,7 +27,7 @@ class Version1031Date20240610134258 extends SimpleMigrationStep {
                $tableDavAbsence = $schema->getTable('dav_absence');
 
                if (!$tableDavAbsence->hasColumn('replacement_user_id')) {
-                       $tableDavAbsence->addColumn('replacement_user_id', Types::STRING, [
+                       $tableDavAbsence->addColumn('dav_absence', Types::STRING, [
                                'notnull' => false,
                                'default' => '',
                                'length' => 64,
index a977f5be43a624c5052466cdf86910e472fce961..3e85edf40b6fc39425b20d50e320f9b375b1db08 100644 (file)
@@ -12,9 +12,12 @@ namespace OCA\Files_Trashbin\Migration;
 use Closure;
 use OCP\DB\ISchemaWrapper;
 use OCP\DB\Types;
+use OCP\Migration\Attributes\AddColumn;
+use OCP\Migration\Attributes\ColumnType;
 use OCP\Migration\IOutput;
 use OCP\Migration\SimpleMigrationStep;
 
+#[AddColumn(table: 'files_trash', name: 'deleted_by', type: ColumnType::STRING)]
 class Version1020Date20240403003535 extends SimpleMigrationStep {
 
        /**
index 281ea1cfbd55a6061c748c5aba245a4336b564ac..eeefc8dd10c67c21929aebcea41d49a6bcc3b4c1 100644 (file)
@@ -11,12 +11,20 @@ namespace OC\Core\Migrations;
 use Closure;
 use OCP\DB\ISchemaWrapper;
 use OCP\DB\Types;
+use OCP\Migration\Attributes\AddIndex;
+use OCP\Migration\Attributes\CreateTable;
+use OCP\Migration\Attributes\IndexType;
 use OCP\Migration\IOutput;
 use OCP\Migration\SimpleMigrationStep;
 
 /**
  *
  */
+#[CreateTable(table: 'taskprocessing_tasks')]
+#[AddIndex(table: 'taskprocessing_tasks', type: IndexType::PRIMARY)]
+#[AddIndex(table: 'taskprocessing_tasks', type: IndexType::INDEX)]
+#[AddIndex(table: 'taskprocessing_tasks', type: IndexType::INDEX)]
+#[AddIndex(table: 'taskprocessing_tasks', type: IndexType::INDEX)]
 class Version30000Date20240429122720 extends SimpleMigrationStep {
 
        /**
index 0b5596a05a90f727fd70388906744aed7df13c30..253b9cc7a644cf0e7f76f51f46d224ae730f4160 100644 (file)
@@ -11,12 +11,17 @@ namespace OC\Core\Migrations;
 use Closure;
 use OCP\DB\ISchemaWrapper;
 use OCP\DB\Types;
+use OCP\Migration\Attributes\AddColumn;
+use OCP\Migration\Attributes\ColumnType;
 use OCP\Migration\IOutput;
 use OCP\Migration\SimpleMigrationStep;
 
 /**
  *
  */
+#[AddColumn(table: 'taskprocessing_tasks', name: 'scheduled_at', type: ColumnType::INTEGER)]
+#[AddColumn(table: 'taskprocessing_tasks', name: 'started_at', type: ColumnType::INTEGER)]
+#[AddColumn(table: 'taskprocessing_tasks', name: 'ended_at', type: ColumnType::INTEGER)]
 class Version30000Date20240708160048 extends SimpleMigrationStep {
 
        /**
index 67293d8c1e72a0923e1bc30a826fd23756da51ba..558ac43238706554c4a8086c58645c78aeda0cdb 100644 (file)
@@ -11,12 +11,16 @@ namespace OC\Core\Migrations;
 use Closure;
 use OCP\DB\ISchemaWrapper;
 use OCP\DB\Types;
+use OCP\Migration\Attributes\AddColumn;
+use OCP\Migration\Attributes\ColumnType;
 use OCP\Migration\IOutput;
 use OCP\Migration\SimpleMigrationStep;
 
 /**
  *
  */
+#[AddColumn(table: 'taskprocessing_tasks', name: 'webhook_uri', type: ColumnType::STRING)]
+#[AddColumn(table: 'taskprocessing_tasks', name: 'webhook_method', type: ColumnType::STRING)]
 class Version30000Date20240717111406 extends SimpleMigrationStep {
 
        /**