summaryrefslogtreecommitdiff
path: root/resources
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 /resources
parentfcfdb216a8878593002bc630060699b30d5236fb (diff)
storage/h2: fix startup failure when indexes are already created
add "if not exists" condition before creating indexes
Diffstat (limited to 'resources')
-rw-r--r--resources/sql/h2_init.sql8
1 files changed, 4 insertions, 4 deletions
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);