Skip to content

Commit

Permalink
add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
bailletced committed Dec 3, 2024
1 parent 0413aa3 commit 8a2327a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate SSL Key for JWT
run: php bin/console lexik:jwt:generate-keypair
- name: Run migrations
run: |
php bin/console doctrine:migrations:migrate --no-interaction || echo "No migrations found or migration failed"
Expand Down
1 change: 0 additions & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ services:
- app-network
environment:
SERVER_NAME: localhost api.openchurch.local admin.openchurch.local
DATABASE_URL: mysql://root:openchurch@db:3306/openchurch?serverVersion=11.5.2-MariaDB&charset=utf8mb4

volumes:
openchurch_db_data: {}
Expand Down
29 changes: 29 additions & 0 deletions migrations/Version20241203150437.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20241203150437 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE field ADD CONSTRAINT FK_5BF54558FDA7B0BF FOREIGN KEY (community_id) REFERENCES community (id)');
$this->addSql('ALTER TABLE field ADD CONSTRAINT FK_5BF5455851D1B0E8 FOREIGN KEY (community_val_id) REFERENCES community (id)');
$this->addSql('ALTER TABLE field ADD CONSTRAINT FK_5BF5455882D54272 FOREIGN KEY (place_val_id) REFERENCES place (id)');
$this->addSql('ALTER TABLE field ADD CONSTRAINT FK_5BF545583414710B FOREIGN KEY (agent_id) REFERENCES agent (id)');
$this->addSql('ALTER TABLE field ADD CONSTRAINT FK_5BF54558DA6A219 FOREIGN KEY (place_id) REFERENCES place (id)');
}

public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE field DROP FOREIGN KEY FK_5BF54558FDA7B0BF');
$this->addSql('ALTER TABLE field DROP FOREIGN KEY FK_5BF5455851D1B0E8');
$this->addSql('ALTER TABLE field DROP FOREIGN KEY FK_5BF5455882D54272');
$this->addSql('ALTER TABLE field DROP FOREIGN KEY FK_5BF545583414710B');
$this->addSql('ALTER TABLE field DROP FOREIGN KEY FK_5BF54558DA6A219');
}
}

0 comments on commit 8a2327a

Please sign in to comment.