migration rollback at path, additional info routs

This commit is contained in:
2024-12-13 14:27:46 +03:00
parent 967bcc28b5
commit 73a64ff717
13 changed files with 156 additions and 76 deletions

View File

@ -30,8 +30,7 @@ class TagModule extends Module
*/
public function init(): void
{
$this->migrationService->runAtPath("{KERNEL_APP_MODULES}/tag/migrations/tag");
$this->migrationService->runAtPath("{KERNEL_APP_MODULES}/tag/migrations/tag_entity");
$this->migrationService->runAtPath("{KERNEL_APP_MODULES}/tag/migrations");
$this->menuService->createItem([
"label" => "Тэги",
@ -49,11 +48,17 @@ class TagModule extends Module
OptionService::createFromParams("entity_tag_list", "{}", "Список тегов");
}
/**
* @throws \Exception
*/
public function deactivate(): void
{
$this->menuService->removeItemBySlug("tag");
$this->menuService->removeItemBySlug("tag_settings");
OptionService::removeOptionByKey("entity_tag_list");
$this->migrationService->rollbackAtPath("{KERNEL_APP_MODULES}/tag/migrations");
}
public function formInputs(string $entity, Model $model = null): void

View File

@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public string $migration;
/**
* Run the migrations.
*/
@ -28,4 +29,5 @@ return new class extends Migration
{
\kernel\App::$db->schema->dropIfExists('tag');
}
};

View File

@ -6,6 +6,8 @@ use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public string $migration;
/**
* Run the migrations.
*/