Skip to content
Snippets Groups Projects
Commit 1d4ee7ef authored by WAGNER ERIC's avatar WAGNER ERIC
Browse files

Mise a jojur de la base de données

parent bdd2ef12
Branches
No related merge requests found
Showing
with 6 additions and 37 deletions
<?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 Version20230329200327 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 ecurie (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, picture VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE pilotes (id INT AUTO_INCREMENT NOT NULL, ecurie_id INT NOT NULL, name VARCHAR(255) NOT NULL, picture VARCHAR(255) NOT NULL, INDEX IDX_E306533657F92A74 (ecurie_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE pilotes ADD CONSTRAINT FK_E306533657F92A74 FOREIGN KEY (ecurie_id) REFERENCES ecurie (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE pilotes DROP FOREIGN KEY FK_E306533657F92A74');
$this->addSql('DROP TABLE ecurie');
$this->addSql('DROP TABLE pilotes');
}
}
...@@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration; ...@@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration;
/** /**
* Auto-generated Migration: Please modify to your needs! * Auto-generated Migration: Please modify to your needs!
*/ */
final class Version20230329195906 extends AbstractMigration final class Version20230330065738 extends AbstractMigration
{ {
public function getDescription(): string public function getDescription(): string
{ {
...@@ -21,17 +21,21 @@ final class Version20230329195906 extends AbstractMigration ...@@ -21,17 +21,21 @@ final class Version20230329195906 extends AbstractMigration
{ {
// this up() migration is auto-generated, please modify it to your needs // this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE clothes (id INT AUTO_INCREMENT NOT NULL, category_id INT NOT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT NOT NULL, picture VARCHAR(255) NOT NULL, price DOUBLE PRECISION NOT NULL, INDEX IDX_3079B48C12469DE2 (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE clothes (id INT AUTO_INCREMENT NOT NULL, category_id INT NOT NULL, ecurie_id INT NOT NULL, name VARCHAR(255) NOT NULL, picture VARCHAR(255) NOT NULL, price DOUBLE PRECISION NOT NULL, INDEX IDX_3079B48C12469DE2 (category_id), INDEX IDX_3079B48C57F92A74 (ecurie_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE ecurie (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, picture VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL, available_at DATETIME NOT NULL, delivered_at DATETIME DEFAULT NULL, INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL, available_at DATETIME NOT NULL, delivered_at DATETIME DEFAULT NULL, INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE clothes ADD CONSTRAINT FK_3079B48C12469DE2 FOREIGN KEY (category_id) REFERENCES category (id)'); $this->addSql('ALTER TABLE clothes ADD CONSTRAINT FK_3079B48C12469DE2 FOREIGN KEY (category_id) REFERENCES category (id)');
$this->addSql('ALTER TABLE clothes ADD CONSTRAINT FK_3079B48C57F92A74 FOREIGN KEY (ecurie_id) REFERENCES ecurie (id)');
} }
public function down(Schema $schema): void public function down(Schema $schema): void
{ {
// this down() migration is auto-generated, please modify it to your needs // this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE clothes DROP FOREIGN KEY FK_3079B48C12469DE2'); $this->addSql('ALTER TABLE clothes DROP FOREIGN KEY FK_3079B48C12469DE2');
$this->addSql('ALTER TABLE clothes DROP FOREIGN KEY FK_3079B48C57F92A74');
$this->addSql('DROP TABLE category'); $this->addSql('DROP TABLE category');
$this->addSql('DROP TABLE clothes'); $this->addSql('DROP TABLE clothes');
$this->addSql('DROP TABLE ecurie');
$this->addSql('DROP TABLE messenger_messages'); $this->addSql('DROP TABLE messenger_messages');
} }
} }
File added
File added
File added
File added
File added
File added
File added
File added
File added
public/img/clothes/mercdes/polo_f1_23_noir.webp

5.5 KiB

File added
File added
File added
public/img/clothes/mercdes/tshirt_f1_22_noir.webp

5.04 KiB

File added
File added
File added
File added
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment