mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-22 19:40:14 -04:00
Migration for meal plan storage
This commit is contained in:
parent
79913096fb
commit
496e633034
7
Makefile
7
Makefile
@ -11,9 +11,9 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
mkfile_dir := $(dir $(mkfile_path))
|
||||
sqlite_url := sqlite://$(mkfile_dir)/.session_store/store.db
|
||||
|
||||
kitchen: wasm kitchen/src/*.rs
|
||||
cd kitchen; cargo build
|
||||
@ -40,5 +40,8 @@ clean:
|
||||
rm -rf web/dist/*
|
||||
cargo clean
|
||||
|
||||
sqlx-migrate:
|
||||
cd kitchen; cargo sqlx migrate run --database-url $(sqlite_url)
|
||||
|
||||
sqlx-prepare:
|
||||
cd kitchen; cargo sqlx prepare --database-url sqlite://$(mkfile_dir)/.session_store/store.db
|
||||
cd kitchen; cargo sqlx prepare --database-url $(sqlite_url)
|
||||
|
3
kitchen/migrations/20221030222458_mealplans_v0.down.sql
Normal file
3
kitchen/migrations/20221030222458_mealplans_v0.down.sql
Normal file
@ -0,0 +1,3 @@
|
||||
-- Add down migration script here
|
||||
drop table plans;
|
||||
drop table plan_recipes;
|
3
kitchen/migrations/20221030222458_mealplans_v0.up.sql
Normal file
3
kitchen/migrations/20221030222458_mealplans_v0.up.sql
Normal file
@ -0,0 +1,3 @@
|
||||
-- Add up migration script here
|
||||
CREATE TABLE plans(id NUMBER, user_id TEXT, date TEXT);
|
||||
CREATE table plan_recipes(plan_id NUMBER, recipe_id TEXT);
|
Loading…
x
Reference in New Issue
Block a user