mirror of
https://github.com/nextcloud/server.git
synced 2026-05-23 18:46:30 -04:00
Fixes in migration step
We cannot set ldap_dn_hash column as notnull because it is empty for existing users before postSchemaChange is called Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
581b1d8da6
commit
aa65a4fe90
1 changed files with 2 additions and 3 deletions
|
|
@ -45,9 +45,8 @@ class Version1130Date20211102154716 extends SimpleMigrationStep {
|
|||
$table = $schema->getTable($tableName);
|
||||
if (!$table->hasColumn('ldap_dn_hash')) {
|
||||
$table->addColumn('ldap_dn_hash', Types::STRING, [
|
||||
'notnull' => true,
|
||||
'notnull' => false,
|
||||
'length' => 64,
|
||||
'default' => '',
|
||||
]);
|
||||
$changeSchema = true;
|
||||
}
|
||||
|
|
@ -74,7 +73,7 @@ class Version1130Date20211102154716 extends SimpleMigrationStep {
|
|||
$table->addUniqueIndex(['ldap_dn_hash'], 'ldap_group_dn_hashes');
|
||||
$changeSchema = true;
|
||||
}
|
||||
if ($table->getPrimaryKeyColumns() !== ['owncloud_name']) {
|
||||
if (!$table->hasPrimaryKey() || ($table->getPrimaryKeyColumns() !== ['owncloud_name'])) {
|
||||
$table->dropPrimaryKey();
|
||||
$table->setPrimaryKey(['owncloud_name']);
|
||||
$changeSchema = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue