123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- declare(strict_types=1);
- namespace OC\Core\Migrations;
- use Closure;
- use OCP\DB\ISchemaWrapper;
- use OCP\DB\Types;
- use OCP\Migration\IOutput;
- use OCP\Migration\SimpleMigrationStep;
- class Version29000Date20240124132201 extends SimpleMigrationStep {
- public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
-
- $schema = $schemaClosure();
- $table = $schema->getTable('appconfig');
-
- if ($table->hasIndex('ac_lazy_i')) {
- $table->dropIndex('ac_lazy_i');
- }
- if ($table->hasIndex('ac_app_lazy_i')) {
- $table->dropIndex('ac_app_lazy_i');
- }
- if ($table->hasIndex('ac_app_lazy_key_i')) {
- $table->dropIndex('ac_app_lazy_key_i');
- }
- if ($table->hasColumn('lazy')) {
- $table->dropColumn('lazy');
- }
-
- if (!$table->hasColumn('type')) {
- $table->addColumn('type', Types::INTEGER, ['notnull' => true, 'default' => 2, 'unsigned' => true]);
- } else {
- $table->modifyColumn('type', ['notnull' => true, 'default' => 2, 'unsigned' => true]);
- }
-
- if ($table->hasIndex('appconfig_config_key_index')) {
- $table->dropIndex('appconfig_config_key_index');
- }
- return $schema;
- }
- }
|