Hello, wondering if anybody can see why this wont run?
sudo wrangler d1 execute mydevdatabase --file schemas/schema.sql
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 DEFAULT,
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
);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 DEFAULT,
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
);
however getting this error:
ERROR 9009: SQL prepare error: near ",": syntax error in 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 DEFAULT,
customer_dismiss INTEGER,
location_id TEXT NOT NULL,
status TEXT NOT NULL, -- new or dismissed
status_type TEXT NOT NULL, -- notification /
other TEXT NOT NULL
); at offset 524 [code: 7500] ERROR 9009: SQL prepare error: near ",": syntax error in 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 DEFAULT,
customer_dismiss INTEGER,
location_id TEXT NOT NULL,
status TEXT NOT NULL, -- new or dismissed
status_type TEXT NOT NULL, -- notification /
other TEXT NOT NULL
); at offset 524 [code: 7500]