Update types.ts

This commit is contained in:
fcarraUniSa
2025-12-23 10:34:47 +01:00
committed by GitHub
parent 155f523a4c
commit 8f01fc8a6f

View File

@@ -18,18 +18,37 @@ export interface ToastMessage {
text: string; text: string;
} }
// Simple schema for n8n SQL generation // Uniform schema for both Postgres and MySQL, showing the VARCHAR id needed for UUIDs
export const SQL_SCHEMA = ` export const SQL_SCHEMA = `
-- Per MySQL
CREATE TABLE IF NOT EXISTS email_templates ( CREATE TABLE IF NOT EXISTS email_templates (
id INT AUTO_INCREMENT PRIMARY KEY, id VARCHAR(255) PRIMARY KEY,
template_key VARCHAR(255) UNIQUE NOT NULL, template_key VARCHAR(255) UNIQUE NOT NULL,
name VARCHAR(255) NOT NULL,
description TEXT,
subject VARCHAR(255), subject VARCHAR(255),
header_html TEXT, header_html MEDIUMTEXT,
body_html TEXT, body_html MEDIUMTEXT,
footer_html TEXT, footer_html MEDIUMTEXT,
full_html TEXT, full_html MEDIUMTEXT,
required_variables JSON, required_variables JSON,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
); );
`;
-- Per PostgreSQL
-- CREATE TABLE IF NOT EXISTS email_templates (
-- id VARCHAR(255) PRIMARY KEY,
-- template_key VARCHAR(255) UNIQUE NOT NULL,
-- name VARCHAR(255) NOT NULL,
-- description TEXT,
-- subject VARCHAR(255),
-- header_html TEXT,
-- body_html TEXT,
-- footer_html TEXT,
-- full_html TEXT,
-- required_variables JSONB,
-- created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-- updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
-- );
`;