migrations/Version20240403092257.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7. * Auto-generated Migration: Please modify to your needs!
  8. */
  9. final class Version20240403092257 extends AbstractMigration
  10. {
  11. public function getDescription(): string
  12. {
  13. return '';
  14. }
  15. public function up(Schema $schema): void
  16. {
  17. // this up() migration is auto-generated, please modify it to your needs
  18. $this->addSql("CREATE TABLE `school_payments` (
  19. `id` INT NOT NULL AUTO_INCREMENT,
  20. `create_date` DATE NOT NULL,
  21. `school_id` INT NOT NULL,
  22. `payment_date` DATE NULL,
  23. `amount` FLOAT NOT NULL,
  24. `comment` VARCHAR(255) NULL DEFAULT NULL,
  25. `created_by` VARCHAR(100) NOT NULL,
  26. PRIMARY KEY (`id`));");
  27. $this->addSql("CREATE TABLE `school_invoice_details` (
  28. `id` INT NOT NULL AUTO_INCREMENT,
  29. `create_date` DATE NOT NULL,
  30. `school_id` INT NOT NULL,
  31. `registration_id` INT NULL,
  32. `amount` FLOAT NOT NULL,
  33. PRIMARY KEY (`id`))");
  34. $this->addSql("update schools set member_pricePerCredit=45,nonmember_pricePerCredit=45 where id = 209;");
  35. $this->addSql("update schools set member_pricePerCredit=40,nonmember_pricePerCredit=40 where id = 212;");
  36. }
  37. public function down(Schema $schema): void
  38. {
  39. // this down() migration is auto-generated, please modify it to your needs
  40. $this->addSql("DROP TABLE `school_payments`;");
  41. $this->addSql("DROP TABLE `school_invoice_details`;");
  42. $this->addSql("update schools set member_pricePerCredit=0,nonmember_pricePerCredit=0 where id = 209;");
  43. $this->addSql("update schools set member_pricePerCredit=0,nonmember_pricePerCredit=0 where id = 212;");
  44. }
  45. }