summaryrefslogtreecommitdiff
path: root/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'migrations')
-rw-r--r--migrations/20250829220738_vapid_keys.sql17
-rw-r--r--migrations/20251009021241_push_subscriptions.sql12
-rw-r--r--migrations/20251028173914_pem_vapid_keys.sql15
3 files changed, 44 insertions, 0 deletions
diff --git a/migrations/20250829220738_vapid_keys.sql b/migrations/20250829220738_vapid_keys.sql
new file mode 100644
index 0000000..64f4295
--- /dev/null
+++ b/migrations/20250829220738_vapid_keys.sql
@@ -0,0 +1,17 @@
+create table vapid_signing_key (
+ key blob
+ not null
+);
+
+create unique index vapid_signing_key_singleton
+ on vapid_signing_key (0);
+
+create table vapid_key (
+ changed_at text
+ not null,
+ changed_sequence bigint
+ not null
+);
+
+create unique index vapid_key_singleton
+ on vapid_key (0);
diff --git a/migrations/20251009021241_push_subscriptions.sql b/migrations/20251009021241_push_subscriptions.sql
new file mode 100644
index 0000000..b42d122
--- /dev/null
+++ b/migrations/20251009021241_push_subscriptions.sql
@@ -0,0 +1,12 @@
+create table push_subscription (
+ endpoint text
+ primary key
+ not null,
+ token text
+ not null
+ references token (id),
+ p256dh text
+ not null,
+ auth text
+ not null
+);
diff --git a/migrations/20251028173914_pem_vapid_keys.sql b/migrations/20251028173914_pem_vapid_keys.sql
new file mode 100644
index 0000000..6302504
--- /dev/null
+++ b/migrations/20251028173914_pem_vapid_keys.sql
@@ -0,0 +1,15 @@
+drop table vapid_signing_key;
+
+create table vapid_signing_key (
+ key text
+ not null
+);
+
+create unique index vapid_signing_key_singleton
+ on vapid_signing_key (0);
+
+-- Whatever key we had, if any, was just destroyed by dropping the table. Delete the metadata
+-- as well so that the server will issue a new one.
+delete
+from
+ vapid_key;