Skip to content
Snippets Groups Projects
Commit 37478089 authored by Zahdi's avatar Zahdi
Browse files

[Progress] minor changes

parent 2458758a
No related branches found
No related tags found
No related merge requests found
Showing
with 50 additions and 474 deletions
......@@ -16,7 +16,6 @@
###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=
###< symfony/framework-bundle ###
MESSENGER_TRANSPORT_DSN=sync://
......@@ -28,6 +27,6 @@ MESSENGER_TRANSPORT_DSN=sync://
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
DATABASE_URL="mysql://aa:aaa@127.0.0.1:3306/citation_db1?serverVersion=8.0"
DATABASE_URL="mysql://root:root@172.18.0.3:3306/wishlist?serverVersion=8.0"
###< doctrine/doctrine-bundle ###
<?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 Version20250319154617 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 item (id INT AUTO_INCREMENT NOT NULL, purchase_proof_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_1F1B251EFECA7547 (purchase_proof_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path 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 COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', 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 item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547');
$this->addSql('DROP TABLE item');
$this->addSql('DROP TABLE purchase_proof');
$this->addSql('DROP TABLE messenger_messages');
}
}
<?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 Version20250319232441 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 item (id INT AUTO_INCREMENT NOT NULL, purchase_proof_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_1F1B251EFECA7547 (purchase_proof_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path 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 COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', 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 item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547');
$this->addSql('DROP TABLE item');
$this->addSql('DROP TABLE purchase_proof');
$this->addSql('DROP TABLE messenger_messages');
}
}
<?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 Version20250319235558 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('ALTER TABLE purchase_proof ADD item_id INT NOT NULL');
$this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2F32C3F7126F525E ON purchase_proof (item_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E');
$this->addSql('DROP INDEX UNIQ_2F32C3F7126F525E ON purchase_proof');
$this->addSql('ALTER TABLE purchase_proof DROP item_id');
}
}
<?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 Version20250319235641 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 item (id INT AUTO_INCREMENT NOT NULL, purchase_proof_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_1F1B251EFECA7547 (purchase_proof_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)');
$this->addSql('ALTER TABLE purchase_proof ADD item_id INT NOT NULL');
$this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2F32C3F7126F525E ON purchase_proof (item_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E');
$this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547');
$this->addSql('DROP TABLE item');
$this->addSql('DROP INDEX UNIQ_2F32C3F7126F525E ON purchase_proof');
$this->addSql('ALTER TABLE purchase_proof DROP item_id');
}
}
<?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 Version20250320000820 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 purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)');
$this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547');
$this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E');
$this->addSql('DROP TABLE purchase_proof');
}
}
<?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 Version20250320000903 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 purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)');
$this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547');
$this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E');
$this->addSql('DROP TABLE purchase_proof');
}
}
<?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 Version20250320001018 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 item (id INT AUTO_INCREMENT NOT NULL, purchase_proof_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_1F1B251EFECA7547 (purchase_proof_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), 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 COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', 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 item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)');
$this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547');
$this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E');
$this->addSql('DROP TABLE item');
$this->addSql('DROP TABLE purchase_proof');
$this->addSql('DROP TABLE messenger_messages');
}
}
<?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 Version20250320001428 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('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547');
$this->addSql('DROP INDEX UNIQ_1F1B251EFECA7547 ON item');
$this->addSql('ALTER TABLE item DROP purchase_proof_id');
$this->addSql('ALTER TABLE purchase_proof ADD item_id INT NOT NULL');
$this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2F32C3F7126F525E ON purchase_proof (item_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE item ADD purchase_proof_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1F1B251EFECA7547 ON item (purchase_proof_id)');
$this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E');
$this->addSql('DROP INDEX UNIQ_2F32C3F7126F525E ON purchase_proof');
$this->addSql('ALTER TABLE purchase_proof DROP item_id');
}
}
<?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 Version20250320001458 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 item (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), 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 COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', 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 purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E');
$this->addSql('DROP TABLE item');
$this->addSql('DROP TABLE purchase_proof');
$this->addSql('DROP TABLE messenger_messages');
}
}
<?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 Version20250320001931 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('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547');
$this->addSql('DROP INDEX UNIQ_1F1B251EFECA7547 ON item');
$this->addSql('ALTER TABLE item DROP purchase_proof_id');
$this->addSql('ALTER TABLE purchase_proof ADD item_id INT NOT NULL');
$this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2F32C3F7126F525E ON purchase_proof (item_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE item ADD purchase_proof_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1F1B251EFECA7547 ON item (purchase_proof_id)');
$this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E');
$this->addSql('DROP INDEX UNIQ_2F32C3F7126F525E ON purchase_proof');
$this->addSql('ALTER TABLE purchase_proof DROP item_id');
}
}
<?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 Version20250320001951 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 item (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), 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 COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', 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 purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E');
$this->addSql('DROP TABLE item');
$this->addSql('DROP TABLE purchase_proof');
$this->addSql('DROP TABLE messenger_messages');
}
}
<?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 Version20250320002407 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 item (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), 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 COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', 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 purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E');
$this->addSql('DROP TABLE item');
$this->addSql('DROP TABLE purchase_proof');
$this->addSql('DROP TABLE messenger_messages');
}
}
......@@ -12,17 +12,17 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/wishlist')]
final class WhishlistController extends AbstractController
final class WishlistController extends AbstractController
{
#[Route(name: 'app_whishlist_index', methods: ['GET'])]
#[Route(name: 'app_wishlist_index', methods: ['GET'])]
public function index(WishlistRepository $wishlistRepository): Response
{
return $this->render('whishlist/index.html.twig', [
return $this->render('wishlist/index.html.twig', [
'wishlists' => $wishlistRepository->findAll(),
]);
}
#[Route('/new', name: 'app_whishlist_new', methods: ['GET', 'POST'])]
#[Route('/new', name: 'app_wishlist_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$wishlist = new Wishlist();
......@@ -33,24 +33,24 @@ final class WhishlistController extends AbstractController
$entityManager->persist($wishlist);
$entityManager->flush();
return $this->redirectToRoute('app_whishlist_index', [], Response::HTTP_SEE_OTHER);
return $this->redirectToRoute('app_wishlist_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('whishlist/new.html.twig', [
return $this->render('wishlist/new.html.twig', [
'wishlist' => $wishlist,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_whishlist_show', methods: ['GET'])]
#[Route('/{id}', name: 'app_wishlist_show', methods: ['GET'])]
public function show(Wishlist $wishlist): Response
{
return $this->render('whishlist/show.html.twig', [
return $this->render('wishlist/show.html.twig', [
'wishlist' => $wishlist,
]);
}
#[Route('/{id}/edit', name: 'app_whishlist_edit', methods: ['GET', 'POST'])]
#[Route('/{id}/edit', name: 'app_wishlist_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Wishlist $wishlist, EntityManagerInterface $entityManager): Response
{
$form = $this->createForm(WishlistType::class, $wishlist);
......@@ -59,16 +59,16 @@ final class WhishlistController extends AbstractController
if ($form->isSubmitted() && $form->isValid()) {
$entityManager->flush();
return $this->redirectToRoute('app_whishlist_index', [], Response::HTTP_SEE_OTHER);
return $this->redirectToRoute('app_wishlist_index', [], Response::HTTP_SEE_OTHER);
}
return $this->render('whishlist/edit.html.twig', [
return $this->render('wishlist/edit.html.twig', [
'wishlist' => $wishlist,
'form' => $form,
]);
}
#[Route('/{id}', name: 'app_whishlist_delete', methods: ['POST'])]
#[Route('/{id}', name: 'app_wishlist_delete', methods: ['POST'])]
public function delete(Request $request, Wishlist $wishlist, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$wishlist->getId(), $request->getPayload()->getString('_token'))) {
......@@ -76,6 +76,6 @@ final class WhishlistController extends AbstractController
$entityManager->flush();
}
return $this->redirectToRoute('app_whishlist_index', [], Response::HTTP_SEE_OTHER);
return $this->redirectToRoute('app_wishlist_index', [], Response::HTTP_SEE_OTHER);
}
}
<form method="post" action="{{ path('app_whishlist_delete', {'id': wishlist.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<form method="post" action="{{ path('app_wishlist_delete', {'id': wishlist.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ wishlist.id) }}">
<button class="btn">Delete</button>
</form>
......@@ -5,9 +5,9 @@
{% block body %}
<h1>Edit Wishlist</h1>
{{ include('whishlist/_form.html.twig', {'button_label': 'Update'}) }}
{{ include('wishlist/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_whishlist_index') }}">back to list</a>
<a href="{{ path('app_wishlist_index') }}">back to list</a>
{{ include('whishlist/_delete_form.html.twig') }}
{{ include('wishlist/_delete_form.html.twig') }}
{% endblock %}
......@@ -23,8 +23,8 @@
<td>{{ wishlist.deadline ? wishlist.deadline|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ wishlist.isDisabled ? 'Yes' : 'No' }}</td>
<td>
<a href="{{ path('app_whishlist_show', {'id': wishlist.id}) }}">show</a>
<a href="{{ path('app_whishlist_edit', {'id': wishlist.id}) }}">edit</a>
<a href="{{ path('app_wishlist_show', {'id': wishlist.id}) }}">show</a>
<a href="{{ path('app_wishlist_edit', {'id': wishlist.id}) }}">edit</a>
</td>
</tr>
{% else %}
......@@ -35,5 +35,5 @@
</tbody>
</table>
<a href="{{ path('app_whishlist_new') }}">Create new</a>
<a href="{{ path('app_wishlist_new') }}">Create new</a>
{% endblock %}
......@@ -5,7 +5,7 @@
{% block body %}
<h1>Create new Wishlist</h1>
{{ include('whishlist/_form.html.twig') }}
{{ include('wishlist/_form.html.twig') }}
<a href="{{ path('app_whishlist_index') }}">back to list</a>
<a href="{{ path('app_wishlist_index') }}">back to list</a>
{% endblock %}
......@@ -3,7 +3,17 @@
{% block title %}Wishlist{% endblock %}
{% block body %}
<h1>Wishlist</h1>
<header>
<div class="user-icon"></div>
<div style="display:flex;justify-content:center;align-items:center;">
<h1>My wishlists</h1>
</div>
<input type="text" placeholder="Search…" class="search-bar">
</header>
<table class="table">
<tbody>
......@@ -26,9 +36,9 @@
</tbody>
</table>
<a href="{{ path('app_whishlist_index') }}">back to list</a>
<a href="{{ path('app_wishlist_index') }}">back to list</a>
<a href="{{ path('app_whishlist_edit', {'id': wishlist.id}) }}">edit</a>
<a href="{{ path('app_wishlist_edit', {'id': wishlist.id}) }}">edit</a>
{{ include('whishlist/_delete_form.html.twig') }}
{{ include('wishlist/_delete_form.html.twig') }}
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment