Skip to content

Commit

Permalink
adds index
Browse files Browse the repository at this point in the history
  • Loading branch information
datengraben committed Feb 11, 2025
1 parent 98f8e7b commit ba3291b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Repository/TimeframeRelations.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public static function initTable(): void {
PRIMARY KEY (timeframe, location, item, tftype)
) $charsetCollate;";

$sql .= "CREATE INDEX idx_{$tableName}_daterange ON $tableName (startdatetime, enddatetime);";

// TODO If we choose to use 9999-01-01 as our "infinity"-date instead of null, we can use the datetime columns in the primary key.

require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
}
Expand Down

0 comments on commit ba3291b

Please sign in to comment.