diff --git a/migrations/Version20260522200819.php b/migrations/Version20260522200819.php index 8971a57..e21e30c 100644 --- a/migrations/Version20260522200819.php +++ b/migrations/Version20260522200819.php @@ -20,8 +20,8 @@ final class Version20260522200819 extends AbstractMigration public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE page (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, title VARCHAR(255) NOT NULL, text TEXT NOT NULL, url VARCHAR(255) NOT NULL, PRIMARY KEY (id))'); - $this->addSql('CREATE TABLE post (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, title VARCHAR(255) NOT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, text TEXT NOT NULL, url VARCHAR(255) NOT NULL, PRIMARY KEY (id))'); + $this->addSql('CREATE TABLE page (id INT GENERATED BY DEFAULT AS IDENTITY, title VARCHAR(255), text TEXT, url VARCHAR(255), PRIMARY KEY (id))'); + $this->addSql('CREATE TABLE post (id INT GENERATED BY DEFAULT AS IDENTITY, title VARCHAR(255), date TIMESTAMP(0) WITHOUT TIME ZONE , text TEXT, url VARCHAR(255), PRIMARY KEY (id))'); } public function down(Schema $schema): void diff --git a/migrations/Version20260522202515.php b/migrations/Version20260522202515.php index 7c4b7f1..b9e05fd 100644 --- a/migrations/Version20260522202515.php +++ b/migrations/Version20260522202515.php @@ -20,8 +20,8 @@ final class Version20260522202515 extends AbstractMigration public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE page ADD published BOOLEAN NOT NULL'); - $this->addSql('ALTER TABLE post ADD published BOOLEAN NOT NULL'); + $this->addSql('ALTER TABLE page ADD published BOOLEAN NOT NULL DEFAULT false'); + $this->addSql('ALTER TABLE post ADD published BOOLEAN NOT NULL DEFAULT false'); } public function down(Schema $schema): void diff --git a/migrations/Version20260522205620.php b/migrations/Version20260522205620.php index 966ea62..d6e3bf3 100644 --- a/migrations/Version20260522205620.php +++ b/migrations/Version20260522205620.php @@ -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 NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY (id))'); - $this->addSql('CREATE TABLE post_tag (post_id INT NOT NULL, tag_id INT NOT NULL, PRIMARY KEY (post_id, tag_id))'); + $this->addSql('CREATE TABLE category (id INT GENERATED BY DEFAULT AS IDENTITY, 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 NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY (id))'); + $this->addSql('CREATE TABLE tag (id INT GENERATED BY DEFAULT AS IDENTITY, 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'); diff --git a/migrations/Version20260601003707.php b/migrations/Version20260601003707.php index 3754a1e..47ec952 100644 --- a/migrations/Version20260601003707.php +++ b/migrations/Version20260601003707.php @@ -20,9 +20,9 @@ final class Version20260601003707 extends AbstractMigration public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE photo (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, file VARCHAR(255) NOT NULL, equipment VARCHAR(255) NOT NULL, location VARCHAR(255) NOT NULL, caption VARCHAR(255) NOT NULL, date DATE NOT NULL, photos_id INT DEFAULT NULL, PRIMARY KEY (id))'); + $this->addSql('CREATE TABLE photo (id INT GENERATED BY DEFAULT AS IDENTITY, file VARCHAR(255), equipment VARCHAR(255), location VARCHAR(255), caption VARCHAR(255), date DATE, photos_id INT DEFAULT NULL, PRIMARY KEY (id))'); $this->addSql('CREATE INDEX IDX_14B78418301EC62 ON photo (photos_id)'); - $this->addSql('CREATE TABLE photos (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, title VARCHAR(255) NOT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, category_id INT DEFAULT NULL, PRIMARY KEY (id))'); + $this->addSql('CREATE TABLE photos (id INT GENERATED BY DEFAULT AS IDENTITY, title VARCHAR(255), date TIMESTAMP(0) WITHOUT TIME ZONE, category_id INT DEFAULT NULL, PRIMARY KEY (id))'); $this->addSql('CREATE INDEX IDX_876E0D912469DE2 ON photos (category_id)'); $this->addSql('ALTER TABLE photo ADD CONSTRAINT FK_14B78418301EC62 FOREIGN KEY (photos_id) REFERENCES photos (id)'); $this->addSql('ALTER TABLE photos ADD CONSTRAINT FK_876E0D912469DE2 FOREIGN KEY (category_id) REFERENCES category (id)'); diff --git a/migrations/Version20260601011643.php b/migrations/Version20260601011643.php index 87a6b71..cce5e9a 100644 --- a/migrations/Version20260601011643.php +++ b/migrations/Version20260601011643.php @@ -20,7 +20,7 @@ final class Version20260601011643 extends AbstractMigration public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE photo ADD alt_text VARCHAR(255) NOT NULL'); + $this->addSql('ALTER TABLE photo ADD alt_text VARCHAR(255)'); } public function down(Schema $schema): void diff --git a/migrations/Version20260601013417.php b/migrations/Version20260601013417.php index b15b0cc..bfc4677 100644 --- a/migrations/Version20260601013417.php +++ b/migrations/Version20260601013417.php @@ -20,8 +20,8 @@ final class Version20260601013417 extends AbstractMigration public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE photos ADD text TEXT NOT NULL'); - $this->addSql('ALTER TABLE photos ADD url VARCHAR(255) NOT NULL'); + $this->addSql('ALTER TABLE photos ADD text TEXT'); + $this->addSql('ALTER TABLE photos ADD url VARCHAR(255)'); } public function down(Schema $schema): void diff --git a/migrations/Version20260601201050.php b/migrations/Version20260601201050.php index 13da816..c4f2218 100644 --- a/migrations/Version20260601201050.php +++ b/migrations/Version20260601201050.php @@ -20,7 +20,7 @@ final class Version20260601201050 extends AbstractMigration public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE photos ADD thumbnail VARCHAR(255) NOT NULL'); + $this->addSql('ALTER TABLE photos ADD thumbnail VARCHAR(255)'); } public function down(Schema $schema): void