From 871ea1569fc1dc5900e3b8233fc9aede8245f15f Mon Sep 17 00:00:00 2001 From: eltrac Date: Fri, 23 Oct 2026 14:38:14 +0800 Subject: storage: migrate from SQLite to H2 add ADR-0002 about migrating to H2 --- resources/sql/h2_init.sql | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 resources/sql/h2_init.sql (limited to 'resources/sql/h2_init.sql') diff --git a/resources/sql/h2_init.sql b/resources/sql/h2_init.sql new file mode 100644 index 0000000..2ca12bd --- /dev/null +++ b/resources/sql/h2_init.sql @@ -0,0 +1,32 @@ +create table if not exists webmention ( + id integer auto_increment primary key, + hash text not null unique, + wm_source text not null, + wm_target text not null, + wm_source_domain text not null, + wm_target_domain text not null, + wm_source_path text not null, + wm_target_path text not null, + lastmod bigint not null +); + +create table if not exists microformats ( + id integer auto_increment primary key, + wm_id integer not null, + mf_type text not null, + mf_data text not null, /* schema on read, store EDN string here */ + + FOREIGN KEY (wm_id) + references webmention(id) + on delete cascade +); + +create table if not exists proxied_photo ( + id integer auto_increment primary key, + wm_id integer not null, + url text not null, + + FOREIGN KEY (wm_id) + references webmention(id) + on delete cascade +); -- cgit v1.2.3