Skip to content

Commit c19da41

Browse files
committed
Test ID
1 parent ab61e6a commit c19da41

File tree

12 files changed

+748
-2
lines changed

12 files changed

+748
-2
lines changed

api/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"symfony/phpunit-bridge": "6.4.*",
3939
"symfony/stopwatch": "6.4.*",
4040
"symfony/var-dumper": "6.4.*",
41-
"symfony/web-profiler-bundle": "6.4.*"
41+
"symfony/web-profiler-bundle": "6.4.*",
42+
"zenstruck/foundry": "^2.0"
4243
},
4344
"config": {
4445
"optimize-autoloader": true,

api/composer.lock

Lines changed: 219 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/config/bundles.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
1414
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
1515
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
16+
Zenstruck\Foundry\ZenstruckFoundryBundle::class => ['dev' => true, 'test' => true],
1617
];

api/config/packages/api_platform.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ api_platform:
1818
extra_properties:
1919
standard_put: true
2020
rfc_7807_compliant_errors: true
21+
denormalization_context:
22+
allow_extra_attributes: false
2123
# change this to true if you use controllers
2224
use_symfony_listeners: false
2325
keep_legacy_inflector: false
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
when@dev: &dev
2+
# See full configuration: https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#full-default-bundle-configuration
3+
zenstruck_foundry:
4+
# Whether to auto-refresh proxies by default (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#auto-refresh)
5+
auto_refresh_proxies: true
6+
7+
when@test: *dev
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
/**
11+
* Auto-generated Migration: Please modify to your needs!
12+
*/
13+
final class Version20240708230111 extends AbstractMigration
14+
{
15+
public function getDescription(): string
16+
{
17+
return '';
18+
}
19+
20+
public function up(Schema $schema): void
21+
{
22+
// this up() migration is auto-generated, please modify it to your needs
23+
$this->addSql('CREATE SEQUENCE main_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
24+
$this->addSql('CREATE SEQUENCE sub_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
25+
$this->addSql('CREATE TABLE main (id INT NOT NULL, sub1_id INT DEFAULT NULL, sub2_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
26+
$this->addSql('CREATE UNIQUE INDEX UNIQ_BF28CD6429662E71 ON main (sub1_id)');
27+
$this->addSql('CREATE UNIQUE INDEX UNIQ_BF28CD643BD3819F ON main (sub2_id)');
28+
$this->addSql('CREATE TABLE sub (id INT NOT NULL, main_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
29+
$this->addSql('CREATE INDEX IDX_580282DC627EA78A ON sub (main_id)');
30+
$this->addSql('ALTER TABLE main ADD CONSTRAINT FK_BF28CD6429662E71 FOREIGN KEY (sub1_id) REFERENCES sub (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
31+
$this->addSql('ALTER TABLE main ADD CONSTRAINT FK_BF28CD643BD3819F FOREIGN KEY (sub2_id) REFERENCES sub (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
32+
$this->addSql('ALTER TABLE sub ADD CONSTRAINT FK_580282DC627EA78A FOREIGN KEY (main_id) REFERENCES main (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
33+
}
34+
35+
public function down(Schema $schema): void
36+
{
37+
// this down() migration is auto-generated, please modify it to your needs
38+
$this->addSql('CREATE SCHEMA public');
39+
$this->addSql('DROP SEQUENCE main_id_seq CASCADE');
40+
$this->addSql('DROP SEQUENCE sub_id_seq CASCADE');
41+
$this->addSql('ALTER TABLE main DROP CONSTRAINT FK_BF28CD6429662E71');
42+
$this->addSql('ALTER TABLE main DROP CONSTRAINT FK_BF28CD643BD3819F');
43+
$this->addSql('ALTER TABLE sub DROP CONSTRAINT FK_580282DC627EA78A');
44+
$this->addSql('DROP TABLE main');
45+
$this->addSql('DROP TABLE sub');
46+
}
47+
}

0 commit comments

Comments
 (0)