From f1dcea6e450ce7fb0d26aa0470118815bf76c527 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 11 Apr 2023 10:57:27 +0200 Subject: sqlite: create indices --- src/sqlite/v01.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/sqlite') diff --git a/src/sqlite/v01.sql b/src/sqlite/v01.sql index 26869b6..88bbc61 100644 --- a/src/sqlite/v01.sql +++ b/src/sqlite/v01.sql @@ -1,8 +1,10 @@ CREATE TABLE cimple_repositories ( id INTEGER PRIMARY KEY, - url TEXT NOT NULL UNIQUE + url TEXT NOT NULL ) STRICT; +CREATE UNIQUE INDEX cimple_repositories_url_index ON cimple_repositories(url); + CREATE TABLE cimple_runs ( id INTEGER PRIMARY KEY, result INTEGER NOT NULL, @@ -11,3 +13,5 @@ CREATE TABLE cimple_runs ( FOREIGN KEY (repo_id) REFERENCES cimple_repositories(id) ON DELETE CASCADE ON UPDATE CASCADE ) STRICT; + +CREATE INDEX cimple_runs_repo_id_index ON cimple_runs(repo_id); -- cgit v1.2.3