-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lung
committed
Sep 22, 2023
1 parent
dcee144
commit c3841c4
Showing
14 changed files
with
411 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/Application/migrations/20230922104721_add_api_secret_entry_code.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Phinx\Migration\AbstractMigration; | ||
|
||
final class AddApiSecretEntryCode extends AbstractMigration | ||
{ | ||
public function up(): void | ||
{ | ||
$tableParticipant = $this->table('participant'); | ||
$tableParticipant->addColumn('entry_date', 'datetime', ['null' => true]); | ||
$tableParticipant->addColumn('entry_code', 'string', ['null' => false, 'default' => 'ABCDEFGH']); | ||
$tableParticipant->save(); | ||
|
||
$tableParticipant->changeColumn('entry_code', 'string', ['null' => false]); | ||
$tableParticipant->save(); | ||
|
||
|
||
$tableEvent = $this->table('event'); | ||
$tableEvent->addColumn('api_secret', 'string', ['null' => false, 'default' => '']); | ||
$tableEvent->save(); | ||
} | ||
|
||
public function down(): void | ||
{ | ||
$participantTable = $this->table('participant'); | ||
$participantTable->removeColumn('entry_date'); | ||
$participantTable->removeColumn('entry_code'); | ||
$participantTable->save(); | ||
|
||
$eventTable = $this->table('event'); | ||
$eventTable->removeColumn('api_secret'); | ||
$eventTable->save(); | ||
} | ||
} |
Oops, something went wrong.