Skip to content

Commit 9c905b5

Browse files
committed
migrate
1 parent 18d9a1e commit 9c905b5

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

migrations/Version20250116125931.php

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
/**
11+
* Auto-generated Migration: Please modify to your needs!
12+
*/
13+
final class Version20250116125931 extends AbstractMigration
14+
{
15+
public function getDescription(): string
16+
{
17+
return '';
18+
}
19+
20+
public function up(Schema $schema): void
21+
{
22+
// this up() migration is auto-generated, please modify it to your needs
23+
$this->addSql('CREATE TABLE link_php (id INT UNSIGNED AUTO_INCREMENT NOT NULL, title VARCHAR(150) NOT NULL, description VARCHAR(500) DEFAULT NULL, url VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
24+
$this->addSql('CREATE TABLE php_function_link_php (php_function_id INT UNSIGNED NOT NULL, link_php_id INT UNSIGNED NOT NULL, INDEX IDX_FE0122389693C840 (php_function_id), INDEX IDX_FE012238805968DF (link_php_id), PRIMARY KEY(php_function_id, link_php_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
25+
$this->addSql('ALTER TABLE php_function_link_php ADD CONSTRAINT FK_FE0122389693C840 FOREIGN KEY (php_function_id) REFERENCES php_function (id) ON DELETE CASCADE');
26+
$this->addSql('ALTER TABLE php_function_link_php ADD CONSTRAINT FK_FE012238805968DF FOREIGN KEY (link_php_id) REFERENCES link_php (id) ON DELETE CASCADE');
27+
}
28+
29+
public function down(Schema $schema): void
30+
{
31+
// this down() migration is auto-generated, please modify it to your needs
32+
$this->addSql('ALTER TABLE php_function_link_php DROP FOREIGN KEY FK_FE0122389693C840');
33+
$this->addSql('ALTER TABLE php_function_link_php DROP FOREIGN KEY FK_FE012238805968DF');
34+
$this->addSql('DROP TABLE link_php');
35+
$this->addSql('DROP TABLE php_function_link_php');
36+
}
37+
}

0 commit comments

Comments
 (0)