Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #8 from conrad784/nextcloud-22
Browse files Browse the repository at this point in the history
fix: executed occ migrations:generate-from-schema
  • Loading branch information
qroac authored Nov 13, 2021
2 parents 671f150 + 2916983 commit 7a6f5ae
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 75 deletions.
75 changes: 0 additions & 75 deletions appinfo/database.xml

This file was deleted.

67 changes: 67 additions & 0 deletions lib/Migration/Version0049Date20211023151735.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

declare(strict_types=1);

namespace OCA\UserISPConfig\Migration;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

/**
* Auto-generated migration step: Please modify to your needs!
*/
class Version0049Date20211023151735 extends SimpleMigrationStep {

/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
*/
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
}

/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

if (!$schema->hasTable('users_ispconfig')) {
$table = $schema->createTable('users_ispconfig');
$table->addColumn('uid', 'string', [
'notnull' => true,
'length' => 64,
'default' => '',
]);
$table->addColumn('displayname', 'string', [
'notnull' => false,
'length' => 64,
]);
$table->addColumn('mailbox', 'string', [
'notnull' => false,
'length' => 64,
]);
$table->addColumn('domain', 'string', [
'notnull' => false,
'length' => 64,
]);
$table->setPrimaryKey(['uid']);
$table->addUniqueIndex(['mailbox', 'domain'], 'mailaddress_unique');
}
return $schema;
}

/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
*/
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
}
}

0 comments on commit 7a6f5ae

Please sign in to comment.