aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-scripts/migrations/20250326160051_create_scripts.up.sql
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@atuin.sh>2025-04-07 14:17:19 +0100
committerGitHub <noreply@github.com>2025-04-07 14:17:19 +0100
commitf162d641a71b95f7febab0c04aba7d64182df38b (patch)
tree37526cbb5a3eedbf5626060ae315de2e67f9f304 /crates/atuin-scripts/migrations/20250326160051_create_scripts.up.sql
parentfix: fish up binding bug (#2677) (diff)
downloadatuin-f162d641a71b95f7febab0c04aba7d64182df38b.zip
feat: support storing, syncing and executing scripts (#2644)
* feat: add atuin-scripts crate * initial * define record types * wip * wip * mvp * add show command, make stdin work * rewrite execution to use shebang and script file ALWAYS * rename show -> get, allow fetching script only * fmt * clippy * a bunch of fixes to the edits * update lock * variables * fmt * clippy * pr feedback * fmt
Diffstat (limited to 'crates/atuin-scripts/migrations/20250326160051_create_scripts.up.sql')
-rw-r--r--crates/atuin-scripts/migrations/20250326160051_create_scripts.up.sql17
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/atuin-scripts/migrations/20250326160051_create_scripts.up.sql b/crates/atuin-scripts/migrations/20250326160051_create_scripts.up.sql
new file mode 100644
index 00000000..1b2f3688
--- /dev/null
+++ b/crates/atuin-scripts/migrations/20250326160051_create_scripts.up.sql
@@ -0,0 +1,17 @@
+-- Add up migration script here
+CREATE TABLE scripts (
+ id TEXT PRIMARY KEY,
+ name TEXT NOT NULL,
+ description TEXT NOT NULL,
+ shebang TEXT NOT NULL,
+ script TEXT NOT NULL,
+ inserted_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now'))
+);
+
+CREATE TABLE script_tags (
+ id INTEGER PRIMARY KEY,
+ script_id TEXT NOT NULL,
+ tag TEXT NOT NULL
+);
+
+CREATE UNIQUE INDEX idx_script_tags ON script_tags (script_id, tag); \ No newline at end of file