Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
|
- <?php
-
- namespace App\Util;
-
- use Exception;
- use Illuminate\Database\Migrations\Migration;
- use Nette\NotImplementedException;
-
- abstract class MigrationEx extends Migration
- {
- public function up(): void
- {
-
- if (!$this->connection) {
- throw new Exception("connection 未定義");
- }
-
- // 共通スキーマの変更は社内テスト(520)の場合のみ行う
- if ($this->connection === "htpms") {
- if (config("database.connections.htpms_customer.database") !== "htpms_520") {
- printf("htpms スキップ\n");
- return;
- }
- }
-
- $this->runUp();
- }
-
- public function down(): void
- {
-
- if (!$this->connection) {
- throw new Exception("connection 未定義");
- }
-
- // 共通スキーマの変更は社内テスト(520)の場合のみ行う
- if ($this->connection === "htpms") {
- if (config("database.connections.htpms_customer.database") !== "htpms_520") {
- printf("htpms スキップ\n");
- return;
- }
- }
-
- $this->runDown();
- }
-
- protected function runUp(): void
- {
- throw new NotImplementedException();
- }
- protected function runDown(): void
- {
- throw new NotImplementedException();
- }
- };
|