Skip to content

Commit b1c6382

Browse files
authored
Fix entries date index update script and migration (#485)
1 parent 38c6b38 commit b1c6382

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

database/migrations/updates/add_index_to_date_on_entries_table.php.stub

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use Statamic\Eloquent\Database\BaseMigration as Migration;
77
return new class extends Migration {
88
public function up()
99
{
10-
if (Schema::hasIndex($this->prefix('entries'), 'date')) {
10+
if (Schema::hasIndex($this->prefix('entries'), ['date'])) {
1111
return;
1212
}
1313

@@ -18,7 +18,7 @@ return new class extends Migration {
1818

1919
public function down()
2020
{
21-
if (! Schema::hasIndex($this->prefix('entries'), 'date')) {
21+
if (! Schema::hasIndex($this->prefix('entries'), ['date'])) {
2222
return;
2323
}
2424

src/Updates/AddIndexToDateOnEntriesTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function shouldUpdate($newVersion, $oldVersion)
1111
{
1212
return $this->isUpdatingTo('4.22.0')
1313
&& Schema::hasTable(config('statamic.eloquent-driver.table_prefix', '').'entries')
14-
&& ! Schema::hasIndex(config('statamic.eloquent-driver.table_prefix', '').'entries', 'date');
14+
&& ! Schema::hasIndex(config('statamic.eloquent-driver.table_prefix', '').'entries', ['date']);
1515
}
1616

1717
public function update()

0 commit comments

Comments
 (0)