From ba68738dfa235b2b975572b2517b045928f89ece Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Thu, 1 Sep 2022 14:37:28 -0400 Subject: [PATCH] SQLite migrations --- kitchen/migrations/20220901233514_recipes_v1.down.sql | 2 ++ kitchen/migrations/20220901233514_recipes_v1.up.sql | 5 +++++ nix/devShell/default.nix | 1 - 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 kitchen/migrations/20220901233514_recipes_v1.down.sql create mode 100644 kitchen/migrations/20220901233514_recipes_v1.up.sql diff --git a/kitchen/migrations/20220901233514_recipes_v1.down.sql b/kitchen/migrations/20220901233514_recipes_v1.down.sql new file mode 100644 index 0000000..089b9a1 --- /dev/null +++ b/kitchen/migrations/20220901233514_recipes_v1.down.sql @@ -0,0 +1,2 @@ +-- Add down migration script here +drop table recipes; \ No newline at end of file diff --git a/kitchen/migrations/20220901233514_recipes_v1.up.sql b/kitchen/migrations/20220901233514_recipes_v1.up.sql new file mode 100644 index 0000000..82c2eb3 --- /dev/null +++ b/kitchen/migrations/20220901233514_recipes_v1.up.sql @@ -0,0 +1,5 @@ +-- Add up migration script here +create table recipes(user_id TEXT NOT NULL, recipe_id TEXT NOT NULL, recipe_text TEXT, + constraint recipe_primary_key primary key (user_id, recipe_id)); +create table categories(user_id TEXT NOT NULL, category_text, + constraint category_primary_key primary key (user_id)); \ No newline at end of file diff --git a/nix/devShell/default.nix b/nix/devShell/default.nix index 49d1e22..4191d05 100644 --- a/nix/devShell/default.nix +++ b/nix/devShell/default.nix @@ -2,5 +2,4 @@ with pkgs; mkShell { buildInputs = (if stdenv.isDarwin then [ pkgs.darwin.apple_sdk.frameworks.Security ] else [ ]) ++ (with pkgs; [wasm-bindgen-cli wasm-pack llvm clang rust-wasm]); - #buildInputs = with pkgs; [wasm-bindgen-cli wasm-pack]; } \ No newline at end of file