Auto increment change
This commit is contained in:
parent
675245d1e0
commit
2eb2ea81f3
3 changed files with 6 additions and 6 deletions
|
|
@ -20,11 +20,11 @@ final class Version20260522205620 extends AbstractMigration
|
|||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE TABLE category (id INT GENERATED BY DEFAULT AS IDENTITY, title VARCHAR(255), PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE TABLE category (id INT AUTO_INCREMENT, title VARCHAR(255), PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE TABLE post_tag (post_id INT, tag_id INT, PRIMARY KEY (post_id, tag_id))');
|
||||
$this->addSql('CREATE INDEX IDX_5ACE3AF04B89032C ON post_tag (post_id)');
|
||||
$this->addSql('CREATE INDEX IDX_5ACE3AF0BAD26311 ON post_tag (tag_id)');
|
||||
$this->addSql('CREATE TABLE tag (id INT GENERATED BY DEFAULT AS IDENTITY, title VARCHAR(255), PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE TABLE tag (id INT AUTO_INCREMENT, title VARCHAR(255), PRIMARY KEY (id))');
|
||||
$this->addSql('ALTER TABLE post_tag ADD CONSTRAINT FK_5ACE3AF04B89032C FOREIGN KEY (post_id) REFERENCES post (id) ON DELETE CASCADE');
|
||||
$this->addSql('ALTER TABLE post_tag ADD CONSTRAINT FK_5ACE3AF0BAD26311 FOREIGN KEY (tag_id) REFERENCES tag (id) ON DELETE CASCADE');
|
||||
$this->addSql('ALTER TABLE post ADD category_id INT DEFAULT NULL');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue