A test fails if docs/schema.sql drifts from the table server.js creates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfmHGGiYUjNcvJoyzdf
23 lines
1.1 KiB
SQL
23 lines
1.1 KiB
SQL
-- Lead storage for ins-landing-page (SQLite).
|
|
--
|
|
-- Reference only: server.js creates this table itself on first start (CREATE TABLE IF NOT EXISTS),
|
|
-- so nobody needs to run this file on deploy. server.test.js fails if this file and server.js
|
|
-- drift apart.
|
|
--
|
|
-- Changing the schema after go-live: CREATE TABLE IF NOT EXISTS never alters an existing table,
|
|
-- so a new column also needs an ALTER TABLE step against the live database.
|
|
|
|
CREATE TABLE IF NOT EXISTS leads (
|
|
id INTEGER PRIMARY KEY,
|
|
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, -- UTC, 'YYYY-MM-DD HH:MM:SS'
|
|
name TEXT NOT NULL,
|
|
email TEXT NOT NULL, -- work email; free providers rejected
|
|
phone TEXT NOT NULL, -- phone / WhatsApp, as typed
|
|
company TEXT NOT NULL,
|
|
service TEXT, -- one of the form's options, or NULL
|
|
referrer TEXT, -- site the visitor came from
|
|
utm_source TEXT,
|
|
utm_medium TEXT,
|
|
utm_campaign TEXT
|
|
);
|