fix : correction des migrations et de la commande make pour lancer les migrations

This commit is contained in:
tristan
2026-02-03 13:11:30 +01:00
parent a34bdbfe8d
commit 13e8698673
4 changed files with 125 additions and 31 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
<driver-ref>postgresql</driver-ref> <driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize> <synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver> <jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://localhost:5432/ferme</jdbc-url> <jdbc-url>jdbc:postgresql://localhost:5433/ferme</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir> <working-dir>$ProjectFileDir$</working-dir>
</data-source> </data-source>
<data-source source="LOCAL" name="Ferme recette" uuid="ae622167-c834-4e7b-87a5-c1721036f5dc"> <data-source source="LOCAL" name="Ferme recette" uuid="ae622167-c834-4e7b-87a5-c1721036f5dc">
+27 -29
View File
@@ -6,11 +6,8 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="feat : mise à jour du bon de réception"> <list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="feat : mise à jour du bon de réception">
<change beforePath="$PROJECT_DIR$/.idea/dataSources.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/dataSources.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/data_source_mapping.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/php.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/php.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/reference.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/reference.php" afterDir="false" /> <change beforePath="$PROJECT_DIR$/config/reference.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/reference.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/makefile" beforeDir="false" afterPath="$PROJECT_DIR$/makefile" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -36,7 +33,7 @@
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_BRANCH_BY_REPOSITORY"> <option name="RECENT_BRANCH_BY_REPOSITORY">
<map> <map>
<entry key="$PROJECT_DIR$" value="feat/poc-identification-bovin" /> <entry key="$PROJECT_DIR$" value="fix/makefile" />
</map> </map>
</option> </option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
@@ -204,6 +201,7 @@
<path value="$PROJECT_DIR$/vendor/malio/ednotif-bundle" /> <path value="$PROJECT_DIR$/vendor/malio/ednotif-bundle" />
<path value="$PROJECT_DIR$/vendor/doctrine/doctrine-fixtures-bundle" /> <path value="$PROJECT_DIR$/vendor/doctrine/doctrine-fixtures-bundle" />
<path value="$PROJECT_DIR$/vendor/doctrine/data-fixtures" /> <path value="$PROJECT_DIR$/vendor/doctrine/data-fixtures" />
<path value="$PROJECT_DIR$/vendor/symfony/maker-bundle" />
</include_path> </include_path>
</component> </component>
<component name="ProjectColorInfo">{ <component name="ProjectColorInfo">{
@@ -216,36 +214,36 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"RunOnceActivity.MCP Project settings loaded": "true", &quot;RunOnceActivity.MCP Project settings loaded&quot;: &quot;true&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true", &quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252&quot;: &quot;true&quot;,
"RunOnceActivity.git.unshallow": "true", &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
"RunOnceActivity.typescript.service.memoryLimit.init": "true", &quot;RunOnceActivity.typescript.service.memoryLimit.init&quot;: &quot;true&quot;,
"git-widget-placeholder": "develop", &quot;git-widget-placeholder&quot;: &quot;develop&quot;,
"last_opened_file_path": "/home/sroy/Documents/test/Ferme", &quot;last_opened_file_path&quot;: &quot;/home/sroy/Documents/test/Ferme&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"settings.editor.selected.configurable": "configurable.group.appearance", &quot;settings.editor.selected.configurable&quot;: &quot;configurable.group.appearance&quot;,
"ts.external.directory.path": "/opt/phpstorm/plugins/javascript-plugin/jsLanguageServicesImpl/external", &quot;ts.external.directory.path&quot;: &quot;/opt/phpstorm/plugins/javascript-plugin/jsLanguageServicesImpl/external&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}, },
"keyToStringList": { &quot;keyToStringList&quot;: {
"DatabaseDriversLRU": [ &quot;DatabaseDriversLRU&quot;: [
"postgresql" &quot;postgresql&quot;
], ],
"com.intellij.ide.scratch.ScratchImplUtil$2/New Scratch File": [ &quot;com.intellij.ide.scratch.ScratchImplUtil$2/New Scratch File&quot;: [
"TEXT" &quot;TEXT&quot;
], ],
"vue.recent.templates": [ &quot;vue.recent.templates&quot;: [
"Vue Composition API Component" &quot;Vue Composition API Component&quot;
] ]
} }
}]]></component> }</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="\\wsl.localhost\Ubuntu-24.04\home\m-tristan\workspace\Ferme" /> <recent name="\\wsl.localhost\Ubuntu-24.04\home\m-tristan\workspace\Ferme" />
+1 -1
View File
@@ -76,7 +76,7 @@ build-without-cache:
--no-cache --no-cache
migration-migrate: migration-migrate:
$(SYMFONY_CONSOLE) doctrine:migrations:migrate --no-interaction $(SYMFONY_CONSOLE) --no-interaction doctrine:migrations:migrate --allow-no-migration
fixtures: fixtures:
$(SYMFONY_CONSOLE) doctrine:fixtures:load $(SYMFONY_CONSOLE) doctrine:fixtures:load
+96
View File
@@ -0,0 +1,96 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260203123000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Normalize index and constraint names to match current Doctrine naming strategy.';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER INDEX idx_1b80e4864c3c5e0a RENAME TO IDX_1B80E48621DFC797');
$this->addSql('ALTER INDEX idx_1b80e4868bebb4b RENAME TO IDX_1B80E486C6957CCE');
$this->addSql('ALTER TABLE supplier_address DROP CONSTRAINT fk_3dce3c746f9b8a0');
$this->addSql('ALTER TABLE supplier_address DROP CONSTRAINT fk_3dce3c74f2c1d6a8');
$this->addSql('ALTER TABLE supplier_address ADD CONSTRAINT FK_8C2B1B9E2ADD6D8C FOREIGN KEY (supplier_id) REFERENCES supplier (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE supplier_address ADD CONSTRAINT FK_8C2B1B9EF5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id) ON DELETE CASCADE');
$this->addSql('ALTER INDEX idx_3dce3c74f2c1d6a8 RENAME TO IDX_8C2B1B9E2ADD6D8C');
$this->addSql('ALTER INDEX idx_3dce3c746f9b8a0 RENAME TO IDX_8C2B1B9EF5B7AF75');
$this->addSql('DROP INDEX uniq_8d93d649f85e0677');
$this->addSql('DROP INDEX uniq_user_username');
$this->addSql('CREATE UNIQUE INDEX UNIQ_327C5DE7F85E0677 ON "user" (username)');
$this->addSql('ALTER INDEX idx_14b3bc5f4c3c5e0a RENAME TO IDX_11667CD921DFC797');
$this->addSql('ALTER INDEX idx_5df3aa933e4a2e34 RENAME TO IDX_5B59B8827C14DF52');
$this->addSql('ALTER INDEX idx_5df3aa93955258d RENAME TO IDX_5B59B882113969D3');
$this->addSql('ALTER INDEX idx_5df3aa934d2a7e12 RENAME TO IDX_5B59B8824D2A7E12');
$this->addSql('ALTER INDEX uniq_reception_identification_number RENAME TO UNIQ_50D6852F347639A5');
$this->addSql('ALTER INDEX idx_83dc02e37bd5b5d RENAME TO IDX_50D6852FB708E8B8');
$this->addSql('ALTER INDEX idx_83dc02e3bcaaa7c0 RENAME TO IDX_50D6852F928E8BF2');
$this->addSql('ALTER INDEX idx_83dc02e3a76ed395 RENAME TO IDX_50D6852FA76ED395');
$this->addSql('ALTER INDEX idx_83dc02e32add6e01 RENAME TO IDX_50D6852F2ADD6D8C');
$this->addSql('ALTER INDEX idx_83dc02e3f5b7af75 RENAME TO IDX_50D6852FF5B7AF75');
$this->addSql('ALTER INDEX idx_83dc02e3f7d15b1a RENAME TO IDX_50D6852FC6957CCE');
$this->addSql('ALTER INDEX idx_83dc02e34c3c5e0a RENAME TO IDX_50D6852F21DFC797');
$this->addSql('ALTER INDEX idx_83dc02e3f24c741b RENAME TO IDX_50D6852FC3423909');
$this->addSql('ALTER TABLE reception_building DROP CONSTRAINT fk_46e7f9f24d2a7e12');
$this->addSql('ALTER TABLE reception_building DROP CONSTRAINT fk_46e7f9f23e4a2e34');
$this->addSql('ALTER TABLE reception_building ADD CONSTRAINT FK_4DA1DCF07C14DF52 FOREIGN KEY (reception_id) REFERENCES reception (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE reception_building ADD CONSTRAINT FK_4DA1DCF04D2A7E12 FOREIGN KEY (building_id) REFERENCES building (id) ON DELETE CASCADE');
$this->addSql('ALTER INDEX idx_46e7f9f23e4a2e34 RENAME TO IDX_4DA1DCF07C14DF52');
$this->addSql('ALTER INDEX idx_46e7f9f24d2a7e12 RENAME TO IDX_4DA1DCF04D2A7E12');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER INDEX IDX_1B80E48621DFC797 RENAME TO idx_1b80e4864c3c5e0a');
$this->addSql('ALTER INDEX IDX_1B80E486C6957CCE RENAME TO idx_1b80e4868bebb4b');
$this->addSql('ALTER TABLE supplier_address DROP CONSTRAINT FK_8C2B1B9E2ADD6D8C');
$this->addSql('ALTER TABLE supplier_address DROP CONSTRAINT FK_8C2B1B9EF5B7AF75');
$this->addSql('ALTER TABLE supplier_address ADD CONSTRAINT fk_3dce3c746f9b8a0 FOREIGN KEY (address_id) REFERENCES address (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE supplier_address ADD CONSTRAINT fk_3dce3c74f2c1d6a8 FOREIGN KEY (supplier_id) REFERENCES supplier (id) ON DELETE CASCADE');
$this->addSql('ALTER INDEX IDX_8C2B1B9E2ADD6D8C RENAME TO idx_3dce3c74f2c1d6a8');
$this->addSql('ALTER INDEX IDX_8C2B1B9EF5B7AF75 RENAME TO idx_3dce3c746f9b8a0');
$this->addSql('DROP INDEX UNIQ_327C5DE7F85E0677');
$this->addSql('CREATE UNIQUE INDEX uniq_8d93d649f85e0677 ON "user" (username)');
$this->addSql('CREATE UNIQUE INDEX uniq_user_username ON "user" (username)');
$this->addSql('ALTER INDEX IDX_11667CD921DFC797 RENAME TO idx_14b3bc5f4c3c5e0a');
$this->addSql('ALTER INDEX IDX_5B59B8827C14DF52 RENAME TO idx_5df3aa933e4a2e34');
$this->addSql('ALTER INDEX IDX_5B59B882113969D3 RENAME TO idx_5df3aa93955258d');
$this->addSql('ALTER INDEX IDX_5B59B8824D2A7E12 RENAME TO idx_5df3aa934d2a7e12');
$this->addSql('ALTER INDEX UNIQ_50D6852F347639A5 RENAME TO uniq_reception_identification_number');
$this->addSql('ALTER INDEX IDX_50D6852FB708E8B8 RENAME TO idx_83dc02e37bd5b5d');
$this->addSql('ALTER INDEX IDX_50D6852F928E8BF2 RENAME TO idx_83dc02e3bcaaa7c0');
$this->addSql('ALTER INDEX IDX_50D6852FA76ED395 RENAME TO idx_83dc02e3a76ed395');
$this->addSql('ALTER INDEX IDX_50D6852F2ADD6D8C RENAME TO idx_83dc02e32add6e01');
$this->addSql('ALTER INDEX IDX_50D6852FF5B7AF75 RENAME TO idx_83dc02e3f5b7af75');
$this->addSql('ALTER INDEX IDX_50D6852FC6957CCE RENAME TO idx_83dc02e3f7d15b1a');
$this->addSql('ALTER INDEX IDX_50D6852F21DFC797 RENAME TO idx_83dc02e34c3c5e0a');
$this->addSql('ALTER INDEX IDX_50D6852FC3423909 RENAME TO idx_83dc02e3f24c741b');
$this->addSql('ALTER TABLE reception_building DROP CONSTRAINT FK_4DA1DCF07C14DF52');
$this->addSql('ALTER TABLE reception_building DROP CONSTRAINT FK_4DA1DCF04D2A7E12');
$this->addSql('ALTER TABLE reception_building ADD CONSTRAINT fk_46e7f9f23e4a2e34 FOREIGN KEY (reception_id) REFERENCES reception (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE reception_building ADD CONSTRAINT fk_46e7f9f24d2a7e12 FOREIGN KEY (building_id) REFERENCES building (id) ON DELETE CASCADE');
$this->addSql('ALTER INDEX IDX_4DA1DCF07C14DF52 RENAME TO idx_46e7f9f23e4a2e34');
$this->addSql('ALTER INDEX IDX_4DA1DCF04D2A7E12 RENAME TO idx_46e7f9f24d2a7e12');
}
}