I believe you need to dump it to a SQL file and reupload.
I believe you need to dump it to a SQL file and reupload.
DROP TABLE IF EXISTS messages;
CREATE TABLE IF NOT EXISTS messages (
title TEXT NOT NULL,
body TEXT NOT NULL,
amount INTEGER NOT NULL,
color TEXT NOT NULL,
event_type TEXT NOT NULL,
e_id TEXT NOT NULL,
i_id TEXT NOT NULL, -- invoice id
o_id TEXT NOT NULL, --
s_id TEXT NOT NULL, -- subscription id
p_id TEXT NOT NULL, -- payment id
c_id TEXT NOT NULL, -- customer id
service TEXT NOT NULL,
email TEXT NOT NULL,
name TEXT NOT NULL,
link TEXT NOT NULL,
related_locations TEXT NOT NULL,
time_stamp INTEGER NOT NULL, -- time_stamp INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP,
customer_dismiss INTEGER, -- 0 or 1
location_id TEXT NOT NULL,
status TEXT NOT NULL, -- new or dismissed
status_type TEXT NOT NULL, -- notification /
other TEXT NOT NULL
);

wrangler.toml works. Is this a Workers or a Pages project?DROP TABLE IF EXISTS messages;
CREATE TABLE IF NOT EXISTS messages (
title TEXT NOT NULL,
body TEXT NOT NULL,
amount INTEGER NOT NULL,
color TEXT NOT NULL,
event_type TEXT NOT NULL,
e_id TEXT NOT NULL,
i_id TEXT NOT NULL, -- invoice id
o_id TEXT NOT NULL, --
s_id TEXT NOT NULL, -- subscription id
p_id TEXT NOT NULL, -- payment id
c_id TEXT NOT NULL, -- customer id
service TEXT NOT NULL,
email TEXT NOT NULL,
name TEXT NOT NULL,
link TEXT NOT NULL,
related_locations TEXT NOT NULL,
time_stamp INTEGER NOT NULL, -- time_stamp INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP,
customer_dismiss INTEGER, -- 0 or 1
location_id TEXT NOT NULL,
status TEXT NOT NULL, -- new or dismissed
status_type TEXT NOT NULL, -- notification /
other TEXT NOT NULL
);wrangler.toml console.log("we start the new DB");
try {
console.log("we start the new DB test 1");
await env.DBNAME_DB.prepare(`insert into messages (location_id,time_stamp,status,customer_dismiss) values (?,?,?,?)`).bind(restaurant_token_used, timestamp_index, 'new', 0).run()
console.log("we start the new DB test 2");
} catch (e) {
console.log("we start the new DB test 3");
console.log({
message: e.message,
cause: e.cause.message,
});
}
console.log("we end the new DB");