<?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 Version20240129072250 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 bildirimler (id INT AUTO_INCREMENT NOT NULL, kullanşici_id INT NOT NULL, mobil_bildirim_id INT DEFAULT NULL, baslik VARCHAR(255) NOT NULL, metin LONGTEXT DEFAULT NULL, tarih DATETIME NOT NULL, okuma TINYINT(1) NOT NULL, yonlendirme VARCHAR(255) NOT NULL, INDEX IDX_42DD4FF66D16AAB8 (kullanşici_id), INDEX IDX_42DD4FF65A9C9251 (mobil_bildirim_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE mobil_bildirimler (id INT AUTO_INCREMENT NOT NULL, baslik VARCHAR(255) NOT NULL, metin LONGTEXT DEFAULT NULL, tarih DATETIME DEFAULT NULL, kullanicilar LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', okuma LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', durum TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE bildirimler ADD CONSTRAINT FK_42DD4FF66D16AAB8 FOREIGN KEY (kullanşici_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE bildirimler ADD CONSTRAINT FK_42DD4FF65A9C9251 FOREIGN KEY (mobil_bildirim_id) REFERENCES mobil_bildirimler (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE bildirimler DROP FOREIGN KEY FK_42DD4FF65A9C9251');
$this->addSql('DROP TABLE bildirimler');
$this->addSql('DROP TABLE mobil_bildirimler');
}
}