You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?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();
- }
- };
|