1
0
Fork 0
mirror of synced 2024-06-29 19:50:26 +12:00

fix: new functions enabled index

This commit is contained in:
Torsten Dittmann 2022-09-14 09:26:22 +02:00
parent 5e5ca0ba16
commit e416f9b017

View file

@ -761,7 +761,15 @@ class V15 extends Migration
$this->projectDB->deleteAttribute('functions', 'vars');
$this->createAttributeFromCollection($this->projectDB, 'functions', 'vars');
}
try {
/**
* Create 'enabled' attribute
*/
@$this->projectDB->deleteAttribute($id, 'status');
$this->createAttributeFromCollection($this->projectDB, $id, 'enabled');
} catch (\Throwable $th) {
Console::warning("'enabled' from {$id}: {$th->getMessage()}");
}
try {
/**
* Create '_key_name' index
@ -773,11 +781,11 @@ class V15 extends Migration
try {
/**
* Create '_key_status' index
* Create '_key_enabled' index
*/
$this->createIndexFromCollection($this->projectDB, $id, '_key_status');
$this->createIndexFromCollection($this->projectDB, $id, '_key_enabled');
} catch (\Throwable $th) {
Console::warning("'_key_status' from {$id}: {$th->getMessage()}");
Console::warning("'_key_enabled' from {$id}: {$th->getMessage()}");
}
try {
@ -1321,6 +1329,10 @@ class V15 extends Migration
$document->getAttribute('execute', [])
));
/**
* Set 'enabled' default.
*/
$document->setAttribute('enabled', true);
/**
* Migrate functions stats.
*/