diff options
| author | Michelle Tilley <michelle@michelletilley.net> | 2025-05-06 08:36:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-06 08:36:32 -0700 |
| commit | a1433e0cefe3ad001d5473faf4312c25bdeea968 (patch) | |
| tree | ee8bc10e1438641338b8ef7f5de00a52e6c7f074 /crates/atuin-kv/migrations | |
| parent | chore(deps): update minspan to 0.1.5 (#2729) (diff) | |
| download | atuin-a1433e0cefe3ad001d5473faf4312c25bdeea968.zip | |
feat: Implement KV as a write-through cache (#2732)
Diffstat (limited to 'crates/atuin-kv/migrations')
| -rw-r--r-- | crates/atuin-kv/migrations/20250501160746_create_kv_db.down.sql | 2 | ||||
| -rw-r--r-- | crates/atuin-kv/migrations/20250501160746_create_kv_db.up.sql | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/crates/atuin-kv/migrations/20250501160746_create_kv_db.down.sql b/crates/atuin-kv/migrations/20250501160746_create_kv_db.down.sql new file mode 100644 index 00000000..bce8dfd3 --- /dev/null +++ b/crates/atuin-kv/migrations/20250501160746_create_kv_db.down.sql @@ -0,0 +1,2 @@ +-- Add down migration script here +DROP TABLE kv; 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); |
