Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Database/Adapter/MariaDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ public function createCollection(string $name, array $attributes = [], array $in
$collection .= "
_tenant INT(11) UNSIGNED DEFAULT NULL,
UNIQUE KEY _uid (_uid, _tenant),
KEY _created_at (_createdAt, _tenant),
KEY _updated_at (_updatedAt, _tenant),
KEY _tenant_id (_id, _tenant)
KEY _created_at (_tenant, _createdAt),
KEY _updated_at (_tenant, _updatedAt),
KEY _tenant_id (_tenant, _id)
";
} else {
$collection .= "
Expand Down
6 changes: 3 additions & 3 deletions src/Database/Adapter/Postgres.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ public function createCollection(string $name, array $attributes = [], array $in
if ($this->sharedTables) {
$collection .= "
CREATE UNIQUE INDEX \"{$namespace}_{$this->tenant}_{$id}_uid\" ON {$this->getSQLTable($id)} (LOWER(_uid), _tenant);
CREATE INDEX \"{$namespace}_{$this->tenant}_{$id}_created\" ON {$this->getSQLTable($id)} (\"_createdAt\", _tenant);
CREATE INDEX \"{$namespace}_{$this->tenant}_{$id}_updated\" ON {$this->getSQLTable($id)} (\"_updatedAt\", _tenant);
CREATE INDEX \"{$namespace}_{$this->tenant}_{$id}_tenant_id\" ON {$this->getSQLTable($id)} (_id, _tenant);
CREATE INDEX \"{$namespace}_{$this->tenant}_{$id}_created\" ON {$this->getSQLTable($id)} (_tenant, \"_createdAt\");
CREATE INDEX \"{$namespace}_{$this->tenant}_{$id}_updated\" ON {$this->getSQLTable($id)} (_tenant, \"_updatedAt\");
CREATE INDEX \"{$namespace}_{$this->tenant}_{$id}_tenant_id\" ON {$this->getSQLTable($id)} (_tenant, _id);
";
} else {
$collection .= "
Expand Down