Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mise ne place des fixtures Expert, Senior et Apprenti #5

Merged
merged 1 commit into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"doctrine/doctrine-bundle": "^2.3",
"doctrine/doctrine-migrations-bundle": "^3.2",
"doctrine/orm": "^2.11",
"fakerphp/faker": "^1.19",
"phpdocumentor/reflection-docblock": "^5.3",
"sensio/framework-extra-bundle": "^5.1",
"symfony/asset": "5.1.*",
Expand Down Expand Up @@ -40,6 +41,7 @@
"twig/twig": "^2.12|^3.0"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.4",
"phpunit/phpunit": "^9.5",
"symfony/browser-kit": "5.1.*",
"symfony/css-selector": "5.1.*",
Expand Down
234 changes: 233 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
];
43 changes: 0 additions & 43 deletions migrations/Version20220411141640.php

This file was deleted.

43 changes: 43 additions & 0 deletions migrations/Version20220411145241.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220411145241 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE categories (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(255) NOT NULL, prix INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE clients (id INT AUTO_INCREMENT NOT NULL, nom_societe VARCHAR(255) DEFAULT NULL, prenom VARCHAR(50) NOT NULL, nom VARCHAR(50) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE operations (id INT AUTO_INCREMENT NOT NULL, client_id INT NOT NULL, categories_id INT NOT NULL, users_id INT DEFAULT NULL, description LONGTEXT NOT NULL, INDEX IDX_2814534819EB6921 (client_id), INDEX IDX_28145348A21214B7 (categories_id), INDEX IDX_2814534867B3B43D (users_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE users (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_1483A5E9E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE operations ADD CONSTRAINT FK_2814534819EB6921 FOREIGN KEY (client_id) REFERENCES clients (id)');
$this->addSql('ALTER TABLE operations ADD CONSTRAINT FK_28145348A21214B7 FOREIGN KEY (categories_id) REFERENCES categories (id)');
$this->addSql('ALTER TABLE operations ADD CONSTRAINT FK_2814534867B3B43D FOREIGN KEY (users_id) REFERENCES users (id)');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE operations DROP FOREIGN KEY FK_28145348A21214B7');
$this->addSql('ALTER TABLE operations DROP FOREIGN KEY FK_2814534819EB6921');
$this->addSql('ALTER TABLE operations DROP FOREIGN KEY FK_2814534867B3B43D');
$this->addSql('DROP TABLE categories');
$this->addSql('DROP TABLE clients');
$this->addSql('DROP TABLE operations');
$this->addSql('DROP TABLE users');
}
}
Loading