diff --git a/.env b/.env index 3815cbdced5ee0bced089b699a78ae5210d1f806..89db31614a100fed6a0e412a66745805e3c94820 100644 --- a/.env +++ b/.env @@ -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 ### diff --git a/migrations/Version20250319154617.php b/migrations/Version20250319154617.php deleted file mode 100644 index 923e42fd5420faf7c6a781e383207fb1ee361499..0000000000000000000000000000000000000000 --- a/migrations/Version20250319154617.php +++ /dev/null @@ -1,37 +0,0 @@ -<?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'); - } -} diff --git a/migrations/Version20250319232441.php b/migrations/Version20250319232441.php deleted file mode 100644 index 802975756a27c75253e43cd3f39368936869719c..0000000000000000000000000000000000000000 --- a/migrations/Version20250319232441.php +++ /dev/null @@ -1,37 +0,0 @@ -<?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'); - } -} diff --git a/migrations/Version20250319235558.php b/migrations/Version20250319235558.php deleted file mode 100644 index ff7671133646ebe1e042d319dfcdb0c633c43571..0000000000000000000000000000000000000000 --- a/migrations/Version20250319235558.php +++ /dev/null @@ -1,35 +0,0 @@ -<?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'); - } -} diff --git a/migrations/Version20250319235641.php b/migrations/Version20250319235641.php deleted file mode 100644 index 328a77c4acca0bce1beca90f0f3b9be3a4d80fbd..0000000000000000000000000000000000000000 --- a/migrations/Version20250319235641.php +++ /dev/null @@ -1,39 +0,0 @@ -<?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'); - } -} diff --git a/migrations/Version20250320000820.php b/migrations/Version20250320000820.php deleted file mode 100644 index d8e5490b066dbc664be55e7e326348e25e7d18d1..0000000000000000000000000000000000000000 --- a/migrations/Version20250320000820.php +++ /dev/null @@ -1,35 +0,0 @@ -<?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'); - } -} diff --git a/migrations/Version20250320000903.php b/migrations/Version20250320000903.php deleted file mode 100644 index c4b987f4d4d26d4120261fc70fd0289939d0cc6f..0000000000000000000000000000000000000000 --- a/migrations/Version20250320000903.php +++ /dev/null @@ -1,35 +0,0 @@ -<?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'); - } -} diff --git a/migrations/Version20250320001018.php b/migrations/Version20250320001018.php deleted file mode 100644 index e292a9b894835671238be06c2cdad9b69ce68df3..0000000000000000000000000000000000000000 --- a/migrations/Version20250320001018.php +++ /dev/null @@ -1,39 +0,0 @@ -<?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'); - } -} diff --git a/migrations/Version20250320001428.php b/migrations/Version20250320001428.php deleted file mode 100644 index cba08978371af6bd9710b73c55e77135aa597486..0000000000000000000000000000000000000000 --- a/migrations/Version20250320001428.php +++ /dev/null @@ -1,41 +0,0 @@ -<?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'); - } -} diff --git a/migrations/Version20250320001458.php b/migrations/Version20250320001458.php deleted file mode 100644 index 345d1e8fff4725016aa11fe221db9d4b238d557b..0000000000000000000000000000000000000000 --- a/migrations/Version20250320001458.php +++ /dev/null @@ -1,37 +0,0 @@ -<?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'); - } -} diff --git a/migrations/Version20250320001931.php b/migrations/Version20250320001931.php deleted file mode 100644 index acff107589c2946865e9553b323abe1c9c92a2f0..0000000000000000000000000000000000000000 --- a/migrations/Version20250320001931.php +++ /dev/null @@ -1,41 +0,0 @@ -<?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'); - } -} diff --git a/migrations/Version20250320001951.php b/migrations/Version20250320001951.php deleted file mode 100644 index 97040f22cc3d7365c65735023a7aff1bf11a0792..0000000000000000000000000000000000000000 --- a/migrations/Version20250320001951.php +++ /dev/null @@ -1,37 +0,0 @@ -<?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'); - } -} diff --git a/migrations/Version20250320002407.php b/migrations/Version20250320002407.php deleted file mode 100644 index 57bc4aedc90dc687ee23f0b3a9331494c5fca01a..0000000000000000000000000000000000000000 --- a/migrations/Version20250320002407.php +++ /dev/null @@ -1,37 +0,0 @@ -<?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'); - } -} diff --git a/src/Controller/WhishlistController.php b/src/Controller/WishlistController.php similarity index 67% rename from src/Controller/WhishlistController.php rename to src/Controller/WishlistController.php index 4709e4306ca7c0138bc35b9b0d1ea4022d1914ad..38de54b476bb5b28c6f303576db209a61670981f 100644 --- a/src/Controller/WhishlistController.php +++ b/src/Controller/WishlistController.php @@ -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); } } diff --git a/templates/whishlist/_delete_form.html.twig b/templates/whishlist/_delete_form.html.twig deleted file mode 100644 index f5360a00849311f21e0093af86cbfad9f4bfff9a..0000000000000000000000000000000000000000 --- a/templates/whishlist/_delete_form.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -<form method="post" action="{{ path('app_whishlist_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> diff --git a/templates/whishlist/edit.html.twig b/templates/whishlist/edit.html.twig deleted file mode 100644 index 9544c2b23cb7db38587d4b626db9410c06bb43df..0000000000000000000000000000000000000000 --- a/templates/whishlist/edit.html.twig +++ /dev/null @@ -1,13 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Edit Wishlist{% endblock %} - -{% block body %} - <h1>Edit Wishlist</h1> - - {{ include('whishlist/_form.html.twig', {'button_label': 'Update'}) }} - - <a href="{{ path('app_whishlist_index') }}">back to list</a> - - {{ include('whishlist/_delete_form.html.twig') }} -{% endblock %} diff --git a/templates/wishlist/_delete_form.html.twig b/templates/wishlist/_delete_form.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..8dbb7d867b0da6f5e1e63de451359a5669bf95c0 --- /dev/null +++ b/templates/wishlist/_delete_form.html.twig @@ -0,0 +1,4 @@ +<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> diff --git a/templates/whishlist/_form.html.twig b/templates/wishlist/_form.html.twig similarity index 100% rename from templates/whishlist/_form.html.twig rename to templates/wishlist/_form.html.twig diff --git a/templates/wishlist/edit.html.twig b/templates/wishlist/edit.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..0002ccaa795a79cfb04a1148106c107e5323d27e --- /dev/null +++ b/templates/wishlist/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit Wishlist{% endblock %} + +{% block body %} + <h1>Edit Wishlist</h1> + + {{ include('wishlist/_form.html.twig', {'button_label': 'Update'}) }} + + <a href="{{ path('app_wishlist_index') }}">back to list</a> + + {{ include('wishlist/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/whishlist/index.html.twig b/templates/wishlist/index.html.twig similarity index 79% rename from templates/whishlist/index.html.twig rename to templates/wishlist/index.html.twig index 60cac94a7ddcae14f1ee92ede25311b067951021..ecf8ee428a4b98a424998773acc9eddef907388f 100644 --- a/templates/whishlist/index.html.twig +++ b/templates/wishlist/index.html.twig @@ -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 %} diff --git a/templates/whishlist/new.html.twig b/templates/wishlist/new.html.twig similarity index 56% rename from templates/whishlist/new.html.twig rename to templates/wishlist/new.html.twig index 3bbb2c1f5c2d1402b504d911fe76214ed28a7fc2..4f115810a00a8d94756aaa7b829cd9596a678d0d 100644 --- a/templates/whishlist/new.html.twig +++ b/templates/wishlist/new.html.twig @@ -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 %} diff --git a/templates/whishlist/show.html.twig b/templates/wishlist/show.html.twig similarity index 59% rename from templates/whishlist/show.html.twig rename to templates/wishlist/show.html.twig index 3d74ac9f07c6d0a58451eead09297463bc44e376..f752ff1777d1f3395a16b0ed52264cbc001704d0 100644 --- a/templates/whishlist/show.html.twig +++ b/templates/wishlist/show.html.twig @@ -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 %}