Skip to content

Commit 1bfad36

Browse files
Use jsonb data type for PostgreSQL to increase perfomance (#82)
Co-authored-by: Jason Varga <[email protected]>
1 parent 0fd3d9d commit 1bfad36

15 files changed

+17
-17
lines changed

database/migrations/create_asset_containers_table.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ return new class extends Migration {
1212
$table->string('handle')->unique();
1313
$table->string('title');
1414
$table->string('disk');
15-
$table->json('settings')->nullable();
15+
$table->jsonb('settings')->nullable();
1616
$table->timestamps();
1717
});
1818
}

database/migrations/create_asset_table.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ return new class extends Migration {
1010
Schema::create($this->prefix('assets_meta'), function (Blueprint $table) {
1111
$table->id();
1212
$table->string('handle')->index();
13-
$table->json('data')->nullable();
13+
$table->jsonb('data')->nullable();
1414
$table->timestamps();
1515
});
1616
}

database/migrations/create_blueprints_table.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ return new class extends Migration {
1212
$table->id();
1313
$table->string('namespace')->nullable()->default(null)->index();
1414
$table->string('handle');
15-
$table->json('data');
15+
$table->jsonb('data');
1616
$table->timestamps();
1717

1818
$table->unique(['handle', 'namespace']);

database/migrations/create_collections_table.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ return new class extends Migration {
1111
$table->id();
1212
$table->string('handle')->unique();
1313
$table->string('title');
14-
$table->json('settings')->nullable();
14+
$table->jsonb('settings')->nullable();
1515
$table->timestamps();
1616
});
1717
}

database/migrations/create_entries_table.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ return new class extends Migration {
1818
$table->string('date')->nullable();
1919
$table->integer('order')->nullable();
2020
$table->string('collection')->index();
21-
$table->json('data');
21+
$table->jsonb('data');
2222
$table->timestamps();
2323

2424
$table->foreign('origin_id')

database/migrations/create_entries_table_with_string_ids.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ return new class extends Migration {
1818
$table->string('date')->nullable();
1919
$table->integer('order')->nullable();
2020
$table->string('collection')->index();
21-
$table->json('data');
21+
$table->jsonb('data');
2222
$table->timestamps();
2323

2424
$table->primary('id');

database/migrations/create_fieldsets_table.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ return new class extends Migration {
1010
Schema::create($this->prefix('fieldsets'), function (Blueprint $table) {
1111
$table->id();
1212
$table->string('handle')->unique();
13-
$table->json('data');
13+
$table->jsonb('data');
1414
$table->timestamps();
1515
});
1616
}

database/migrations/create_form_submissions_table.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ return new class extends Migration {
1010
Schema::create($this->prefix('form_submissions'), function (Blueprint $table) {
1111
$table->id();
1212
$table->foreignId('form_id')->constrained($this->prefix('forms'))->cascadeOnDelete();
13-
$table->json('data')->nullable();
13+
$table->jsonb('data')->nullable();
1414
$table->timestamps(6);
1515

1616
$table->unique(['form_id', 'created_at']);

database/migrations/create_forms_table.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ return new class extends Migration {
1111
$table->id();
1212
$table->string('handle')->unique();
1313
$table->string('title');
14-
$table->json('settings')->nullable();
14+
$table->jsonb('settings')->nullable();
1515
$table->timestamps();
1616
});
1717
}

database/migrations/create_globals_table.php.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ return new class extends Migration {
1111
$table->id();
1212
$table->string('handle')->unique();
1313
$table->string('title');
14-
$table->json('localizations');
14+
$table->jsonb('localizations');
1515
$table->timestamps();
1616
});
1717
}

0 commit comments

Comments
 (0)