From a1433e0cefe3ad001d5473faf4312c25bdeea968 Mon Sep 17 00:00:00 2001
From: Michelle Tilley <michelle@michelletilley.net>
Date: Tue, 6 May 2025 08:36:32 -0700
Subject: feat: Implement KV as a write-through cache (#2732)

---
 .../atuin-kv/migrations/20250501160746_create_kv_db.up.sql   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 crates/atuin-kv/migrations/20250501160746_create_kv_db.up.sql

(limited to 'crates/atuin-kv/migrations/20250501160746_create_kv_db.up.sql')

diff --git a/crates/atuin-kv/migrations/20250501160746_create_kv_db.up.sql b/crates/atuin-kv/migrations/20250501160746_create_kv_db.up.sql
new file mode 100644
index 00000000..77384044
--- /dev/null
+++ b/crates/atuin-kv/migrations/20250501160746_create_kv_db.up.sql
@@ -0,0 +1,12 @@
+-- Add up migration script here
+CREATE TABLE
+  kv (
+    namespace TEXT NOT NULL,
+    key TEXT NOT NULL,
+    value TEXT NOT NULL,
+    inserted_at INTEGER NOT NULL DEFAULT (strftime ('%s', 'now'))
+  );
+
+CREATE INDEX idx_kv_namespace ON kv (namespace);
+
+CREATE UNIQUE INDEX idx_kv ON kv (namespace, key);
-- 
cgit v1.3.1

