summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-10-24 18:53:45 +0800
committereltrac <hi@eltr.ac>2026-10-24 18:53:45 +0800
commit7530424d5d1b2c70d847e53f99c3d8e9b25d1d79 (patch)
tree1334682e643950e75ab4cde967d325df24480fac
parentfcfdb216a8878593002bc630060699b30d5236fb (diff)
storage/h2: fix startup failure when indexes are already created
add "if not exists" condition before creating indexes
-rw-r--r--project.clj2
-rw-r--r--resources/sql/h2_init.sql8
2 files changed, 5 insertions, 5 deletions
diff --git a/project.clj b/project.clj
index 0ec358b..5b46a17 100644
--- a/project.clj
+++ b/project.clj
@@ -1,4 +1,4 @@
-(defproject weepinbell "v1.0.0-818b2d0"
+(defproject weepinbell "v1.0.0-fcfdb21"
:description "A Webmention receiver written in Clojure."
:url "https://codeberg.org/eltrac/weepinbell"
:license {:name "GNU Affero General Public License"
diff --git a/resources/sql/h2_init.sql b/resources/sql/h2_init.sql
index 475987f..4674842 100644
--- a/resources/sql/h2_init.sql
+++ b/resources/sql/h2_init.sql
@@ -31,10 +31,10 @@ create table if not exists proxied_photo (
on delete cascade
);
-create index idx_webmention_hash on webmention (hash);
+create index if not exists idx_webmention_hash on webmention (hash);
-create index idx_webmention_pair on webmention (wm_source, wm_target);
+create index if not exists idx_webmention_pair on webmention (wm_source, wm_target);
-create index idx_webmention_domain on webmention (wm_target_domain);
+create index if not exists idx_webmention_domain on webmention (wm_target_domain);
-create index idx_webmention_uri on webmention (wm_target_domain, wm_target_path);
+create index if not exists idx_webmention_uri on webmention (wm_target_domain, wm_target_path);