Enforce uniqueness
This commit is contained in:
parent
e2cf30a307
commit
a0580ad085
@ -24,6 +24,9 @@ class SqliteImageDb implements ImageDb {
|
||||
quality INTEGER NULLABLE,
|
||||
content TEXT NOT NULL
|
||||
)');
|
||||
|
||||
// Create a unique index on the path and params
|
||||
$this->db->exec('CREATE UNIQUE INDEX IF NOT EXISTS images_path_width_height_quality ON images (path, width, height, quality)');
|
||||
}
|
||||
|
||||
public function findImage(string $path, ResizeParams $params): Image | null {
|
||||
|
Loading…
Reference in New Issue
Block a user