summaryrefslogtreecommitdiff
path: root/app/Schema/Migration0.php
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-11 09:25:03 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-11 09:25:03 +0100
commit4c5724df39a4f22d5b1b1117cc4a6200ce186784 (patch)
tree431dad255d5cf0f48d4002f21d49c762579b1ee1 /app/Schema/Migration0.php
parenta64cc9967a255bf52811e8a74d2e30f88cb56671 (diff)
downloadwebtrees-firebird.tar.gz
webtrees-firebird.tar.bz2
webtrees-firebird.zip
Add Firebird/PDO support via lsces/illuminate-firebirdHEADv2.2.7-lscfirebird
Diffstat (limited to 'app/Schema/Migration0.php')
-rwxr-xr-x[-rw-r--r--]app/Schema/Migration0.php41
1 files changed, 33 insertions, 8 deletions
diff --git a/app/Schema/Migration0.php b/app/Schema/Migration0.php
index 9ce32de43d..6c51f55d46 100644..100755
--- a/app/Schema/Migration0.php
+++ b/app/Schema/Migration0.php
@@ -86,7 +86,10 @@ class Migration0 implements MigrationInterface
$key = DB::prefix($table->getTable() . '_primary');
$table->primary(['user_id', 'gedcom_id', 'setting_name'], $key);
- $table->index('gedcom_id');
+ if (DB::driverName() != DB::FIREBIRD) {
+ // since index exists for gedcom_id will not add duplicate
+ $table->index('gedcom_id');
+ }
$table->foreign('user_id')->references('user_id')->on('user');
$table->foreign('gedcom_id')->references('gedcom_id')->on('gedcom');
@@ -164,7 +167,11 @@ class Migration0 implements MigrationInterface
$table->longText('i_gedcom');
$table->primary(['i_id', 'i_file']);
- $table->unique(['i_file', 'i_id']);
+ if (DB::driverName() != DB::FIREBIRD) {
+ // since a usable index exists firebird will not add duplicate
+ $table->unique(['i_file', 'i_id']);
+ }
+
});
DB::schema()->create('families', static function (Blueprint $table): void {
@@ -176,7 +183,10 @@ class Migration0 implements MigrationInterface
$table->integer('f_numchil');
$table->primary(['f_id', 'f_file']);
- $table->unique(['f_file', 'f_id']);
+ if (DB::driverName() != DB::FIREBIRD) {
+ // since a usable index exists firebird will not add duplicate
+ $table->unique(['f_file', 'f_id']);
+ }
$table->index('f_husb');
$table->index('f_wife');
});
@@ -238,7 +248,10 @@ class Migration0 implements MigrationInterface
$table->longText('m_gedcom')->nullable();
$table->primary(['m_file', 'm_id']);
- $table->unique(['m_id', 'm_file']);
+ if (DB::driverName() != DB::FIREBIRD) {
+ // since a usable index exists firebird will not add duplicate
+ $table->unique(['m_id', 'm_file']);
+ }
// Originally, this migration created an index on m_ext and m_type,
// but we drop those columns in migration 37.
});
@@ -260,7 +273,10 @@ class Migration0 implements MigrationInterface
$table->longText('o_gedcom');
$table->primary(['o_id', 'o_file']);
- $table->unique(['o_file', 'o_id']);
+ if (DB::driverName() != DB::FIREBIRD) {
+ // since a usable index exists firebird will not add duplicate
+ $table->unique(['o_file', 'o_id']);
+ }
});
DB::schema()->create('sources', static function (Blueprint $table): void {
@@ -270,7 +286,10 @@ class Migration0 implements MigrationInterface
$table->longText('s_gedcom');
$table->primary(['s_id', 's_file']);
- $table->unique(['s_file', 's_id']);
+ if (DB::driverName() != DB::FIREBIRD) {
+ // since a usable index exists firebird will not add duplicate
+ $table->unique(['s_file', 's_id']);
+ }
$table->index('s_name');
});
@@ -281,7 +300,10 @@ class Migration0 implements MigrationInterface
$table->string('l_to', 20);
$table->primary(['l_from', 'l_file', 'l_type', 'l_to']);
- $table->unique(['l_to', 'l_file', 'l_type', 'l_from']);
+ if (DB::driverName() != DB::FIREBIRD) {
+ // since a usable index exists firebird will not add duplicate
+ $table->unique(['l_to', 'l_file', 'l_type', 'l_from']);
+ }
});
DB::schema()->create('name', static function (Blueprint $table): void {
@@ -336,7 +358,10 @@ class Migration0 implements MigrationInterface
$key1 = DB::prefix($table->getTable() . '_ix1');
$table->primary(['module_name', 'gedcom_id', 'component'], $key0);
- $table->unique(['gedcom_id', 'module_name', 'component'], $key1);
+ if (DB::driverName() != DB::FIREBIRD) {
+ // since a usable index exists firebird will not add duplicate
+ $table->unique(['gedcom_id', 'module_name', 'component'], $key1);
+ }
$table->foreign('module_name')->references('module_name')->on('module');
$table->foreign('gedcom_id')->references('gedcom_id')->on('gedcom');