Martial
Martial
CDCloudflare Developers
Created by Denver James Duran on 2/12/2024 in #d1-database
Nevermind team, I found a workaround, so
Since the table is no longer temporary, you'll need to add a DROP TABLE temp_message also
4 replies
CDCloudflare Developers
Created by Denver James Duran on 2/12/2024 in #d1-database
Nevermind team, I found a workaround, so
PRAGMA defer_foreign_keys = true;
CREATE TABLE temp_message AS
SELECT id, content,
FROM message;

DROP TABLE message;

CREATE TABLE message (
id integer PRIMARY KEY AUTOINCREMENT NOT NULL,
content text NOT NULL,
FOREIGN KEY (chat_id) REFERENCES chat(id) ON UPDATE no action ON DELETE CASCADE
);

INSERT INTO message (id, content)
SELECT id, content
FROM temp_message;
PRAGMA defer_foreign_keys = false;
PRAGMA defer_foreign_keys = true;
CREATE TABLE temp_message AS
SELECT id, content,
FROM message;

DROP TABLE message;

CREATE TABLE message (
id integer PRIMARY KEY AUTOINCREMENT NOT NULL,
content text NOT NULL,
FOREIGN KEY (chat_id) REFERENCES chat(id) ON UPDATE no action ON DELETE CASCADE
);

INSERT INTO message (id, content)
SELECT id, content
FROM temp_message;
PRAGMA defer_foreign_keys = false;
4 replies
CDCloudflare Developers
Created by Denver James Duran on 2/12/2024 in #d1-database
Nevermind team, I found a workaround, so
I was changing a foreign key from Restrict to Cascade for deleting in my case, on the table message, here's the code:
4 replies
CDCloudflare Developers
Created by Denver James Duran on 2/12/2024 in #d1-database
Nevermind team, I found a workaround, so
Thank you for posting ! Removing the TEMPORARY keyword made it work. Also I had to PRAGMA defer_foreign_keys = true; at the start of my migration file and PRAGMA defer_foreign_keys = false; at the end
4 replies
NNuxt
Created by Martial on 5/29/2024 in #❓・help
Throwing and catching errors in CF workers
error.data.statusMessage works also in prod so I'll use that.
2 replies
NNuxt
Created by takburger on 5/3/2024 in #❓・help
How to use Lucia with Nuxt Hub ? (error: missing cloudflare db binding)
I know the pain, glad it helped
80 replies
NNuxt
Created by takburger on 5/3/2024 in #❓・help
How to use Lucia with Nuxt Hub ? (error: missing cloudflare db binding)
80 replies
NNuxt
Created by takburger on 5/3/2024 in #❓・help
How to use Lucia with Nuxt Hub ? (error: missing cloudflare db binding)
I have a lucia + D1 + drizzle setup (without nuxthub) that is working and deployed on CF
80 replies
NNuxt
Created by Martial on 5/14/2024 in #❓・help
How can I prevent VSCode from adding the import statement for auto-imported components?
This seems to work, thanks mate !
7 replies
NNuxt
Created by Martial on 5/14/2024 in #❓・help
How can I prevent VSCode from adding the import statement for auto-imported components?
I need to try that!
7 replies
NNuxt
Created by Martial on 5/14/2024 in #❓・help
How can I prevent VSCode from adding the import statement for auto-imported components?
Maybe we can look into how to tweak vscode config so that it doesnt suggest to import from the component directory
7 replies
CDCloudflare Developers
Created by shengyuan on 4/16/2024 in #workers-help
Does the local runtime support streaming response?
No description
2 replies