From cc1b39c84166dad3f464de7d3f68de56d0305abf Mon Sep 17 00:00:00 2001 From: Dmitry Date: Sat, 19 Oct 2024 16:40:52 -0700 Subject: [PATCH] Refactor budget elements. --- src/EconumoOneBundle/Domain/Entity/BudgetElementOption.php | 2 +- .../Doctrine/Entity/mapping/BudgetElementOption.orm.xml | 2 +- .../Infrastructure/Doctrine/Migration/Version20241019044312.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EconumoOneBundle/Domain/Entity/BudgetElementOption.php b/src/EconumoOneBundle/Domain/Entity/BudgetElementOption.php index a6f21c3f..7f366bf3 100644 --- a/src/EconumoOneBundle/Domain/Entity/BudgetElementOption.php +++ b/src/EconumoOneBundle/Domain/Entity/BudgetElementOption.php @@ -12,7 +12,7 @@ class BudgetElementOption { - public const POSITION_UNSET = -1; + public const POSITION_UNSET = 0; private DateTimeImmutable $createdAt; diff --git a/src/EconumoOneBundle/Infrastructure/Doctrine/Entity/mapping/BudgetElementOption.orm.xml b/src/EconumoOneBundle/Infrastructure/Doctrine/Entity/mapping/BudgetElementOption.orm.xml index 30e83b3f..df952d36 100644 --- a/src/EconumoOneBundle/Infrastructure/Doctrine/Entity/mapping/BudgetElementOption.orm.xml +++ b/src/EconumoOneBundle/Infrastructure/Doctrine/Entity/mapping/BudgetElementOption.orm.xml @@ -13,7 +13,7 @@ - + diff --git a/src/EconumoOneBundle/Infrastructure/Doctrine/Migration/Version20241019044312.php b/src/EconumoOneBundle/Infrastructure/Doctrine/Migration/Version20241019044312.php index 15f7a5b7..7c9316bd 100644 --- a/src/EconumoOneBundle/Infrastructure/Doctrine/Migration/Version20241019044312.php +++ b/src/EconumoOneBundle/Infrastructure/Doctrine/Migration/Version20241019044312.php @@ -52,7 +52,7 @@ public function up(Schema $schema) : void , currency_id CHAR(36) DEFAULT NULL --(DC2Type:uuid) , folder_id CHAR(36) DEFAULT NULL --(DC2Type:uuid) , created_at DATETIME NOT NULL --(DC2Type:datetime_immutable) - , updated_at DATETIME NOT NULL, position SMALLINT DEFAULT 0 NOT NULL, PRIMARY KEY(element_id, element_type, budget_id))'); + , updated_at DATETIME NOT NULL, position SMALLINT UNSIGNED DEFAULT 0 NOT NULL, PRIMARY KEY(element_id, element_type, budget_id))'); $this->addSql('CREATE INDEX IDX_519D432336ABA6B8 ON budgets_elements_options (budget_id)'); $this->addSql('CREATE INDEX IDX_519D432338248176 ON budgets_elements_options (currency_id)'); $this->addSql('CREATE INDEX IDX_519D4323162CB942 ON budgets_elements_options (folder_id)');