Skip to content

Commit 8a2327a

Browse files
committed
add migration
1 parent 0413aa3 commit 8a2327a

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

.github/workflows/github-actions.yml

-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ jobs:
4949
restore-keys: ${{ runner.os }}-composer-
5050
- name: Install Dependencies
5151
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
52-
- name: Generate SSL Key for JWT
53-
run: php bin/console lexik:jwt:generate-keypair
5452
- name: Run migrations
5553
run: |
5654
php bin/console doctrine:migrations:migrate --no-interaction || echo "No migrations found or migration failed"

compose.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ services:
6161
- app-network
6262
environment:
6363
SERVER_NAME: localhost api.openchurch.local admin.openchurch.local
64-
DATABASE_URL: mysql://root:openchurch@db:3306/openchurch?serverVersion=11.5.2-MariaDB&charset=utf8mb4
6564

6665
volumes:
6766
openchurch_db_data: {}

migrations/Version20241203150437.php

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
final class Version20241203150437 extends AbstractMigration
11+
{
12+
public function up(Schema $schema): void
13+
{
14+
$this->addSql('ALTER TABLE field ADD CONSTRAINT FK_5BF54558FDA7B0BF FOREIGN KEY (community_id) REFERENCES community (id)');
15+
$this->addSql('ALTER TABLE field ADD CONSTRAINT FK_5BF5455851D1B0E8 FOREIGN KEY (community_val_id) REFERENCES community (id)');
16+
$this->addSql('ALTER TABLE field ADD CONSTRAINT FK_5BF5455882D54272 FOREIGN KEY (place_val_id) REFERENCES place (id)');
17+
$this->addSql('ALTER TABLE field ADD CONSTRAINT FK_5BF545583414710B FOREIGN KEY (agent_id) REFERENCES agent (id)');
18+
$this->addSql('ALTER TABLE field ADD CONSTRAINT FK_5BF54558DA6A219 FOREIGN KEY (place_id) REFERENCES place (id)');
19+
}
20+
21+
public function down(Schema $schema): void
22+
{
23+
$this->addSql('ALTER TABLE field DROP FOREIGN KEY FK_5BF54558FDA7B0BF');
24+
$this->addSql('ALTER TABLE field DROP FOREIGN KEY FK_5BF5455851D1B0E8');
25+
$this->addSql('ALTER TABLE field DROP FOREIGN KEY FK_5BF5455882D54272');
26+
$this->addSql('ALTER TABLE field DROP FOREIGN KEY FK_5BF545583414710B');
27+
$this->addSql('ALTER TABLE field DROP FOREIGN KEY FK_5BF54558DA6A219');
28+
}
29+
}

0 commit comments

Comments
 (0)