From 211d20ce3707798bef25a8b2cfcb9376eba521ff Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Sat, 4 Nov 2023 20:11:14 +0530 Subject: [PATCH] functions: Make the db available in prod MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit a miss config 😅 --- functions/wrangler.toml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/functions/wrangler.toml b/functions/wrangler.toml index 7395e8a..c80d061 100644 --- a/functions/wrangler.toml +++ b/functions/wrangler.toml @@ -12,6 +12,15 @@ vars = { ENVIRONMENT = "staging" } [env.production] vars = { ENVIRONMENT = "production" } +[[d1_databases]] +binding = "DB" # i.e. available in your Worker on env.DB +database_name = "main-website-api" +database_id = "c8bb7d86-947c-4a47-a84b-e77bcc72aa79" + +[[env.production.d1_databases]] +binding = "DB" # i.e. available in your Worker on env.DB +database_name = "main-website-api" +database_id = "c8bb7d86-947c-4a47-a84b-e77bcc72aa79" # Variable bindings. These are arbitrary, plaintext strings (similar to environment variables) # Note: Use secrets to store sensitive data. @@ -60,8 +69,3 @@ vars = { ENVIRONMENT = "production" } # [[migrations]] # tag = "v1" # new_classes = ["MyDurableObject"] - -[[d1_databases]] -binding = "DB" # i.e. available in your Worker on env.DB -database_name = "main-website-api" -database_id = "c8bb7d86-947c-4a47-a84b-e77bcc72aa79"