This commit is contained in:
2025-12-08 01:23:46 +01:00
parent e50bf86062
commit d891dfa342
2 changed files with 87 additions and 63 deletions

View File

@@ -1,6 +1,11 @@
-- Schema-Dump für `d044ae9e` (erstellt am 2025-12-07 02:21:49 UTC)
-- Schema-Dump für `d044ae9e` (erstellt am 2025-12-08 00:14:08 UTC)
-- Hinweis: Es werden nur CREATE-Anweisungen ausgegeben, bestehende Tabellen bleiben unangetastet.
CREATE DATABASE IF NOT EXISTS `d044ae9e` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
USE `d044ae9e`;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- Tabelle: customers
CREATE TABLE IF NOT EXISTS `customers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -101,7 +106,6 @@ CREATE TABLE IF NOT EXISTS `emailtemplate_customer_settings` (
`bridge_token` varchar(255) DEFAULT NULL,
`sender_token` varchar(255) DEFAULT NULL,
`external_api_token` varchar(255) DEFAULT NULL,
`bridge_tables` text DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`customer_id`)
@@ -123,33 +127,6 @@ CREATE TABLE IF NOT EXISTS `emailtemplate_customer_tokens` (
CONSTRAINT `emailtemplate_customer_tokens_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `emailtemplate_customers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- Tabelle: emailtemplate_sender_identities
CREATE TABLE IF NOT EXISTS `emailtemplate_sender_identities` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`customer_id` int(10) unsigned NOT NULL,
`label` varchar(255) NOT NULL,
`from_name` varchar(255) DEFAULT NULL,
`from_email` varchar(255) NOT NULL,
`reply_to` varchar(255) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `idx_sender_customer` (`customer_id`),
KEY `idx_sender_email` (`from_email`),
CONSTRAINT `fk_sender_customer` FOREIGN KEY (`customer_id`) REFERENCES `emailtemplate_customers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- Tabelle: emailtemplate_template_usage
CREATE TABLE IF NOT EXISTS `emailtemplate_template_usage` (
`template_id` int(10) unsigned NOT NULL,
`customer_id` int(10) unsigned NOT NULL,
`render_count` int(10) unsigned NOT NULL DEFAULT 0,
`last_rendered_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`template_id`),
KEY `idx_usage_customer` (`customer_id`),
CONSTRAINT `fk_usage_template` FOREIGN KEY (`template_id`) REFERENCES `emailtemplate_templates` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- Tabelle: emailtemplate_customer_users
CREATE TABLE IF NOT EXISTS `emailtemplate_customer_users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -203,6 +180,22 @@ CREATE TABLE IF NOT EXISTS `emailtemplate_section_items` (
CONSTRAINT `fk_sitems_section` FOREIGN KEY (`section_id`) REFERENCES `emailtemplate_sections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- Tabelle: emailtemplate_sender_identities
CREATE TABLE IF NOT EXISTS `emailtemplate_sender_identities` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`customer_id` int(10) unsigned NOT NULL,
`label` varchar(255) NOT NULL,
`from_name` varchar(255) DEFAULT NULL,
`from_email` varchar(255) NOT NULL,
`reply_to` varchar(255) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `idx_sender_customer` (`customer_id`),
KEY `idx_sender_email` (`from_email`),
CONSTRAINT `fk_sender_customer` FOREIGN KEY (`customer_id`) REFERENCES `emailtemplate_customers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- Tabelle: emailtemplate_snippets
CREATE TABLE IF NOT EXISTS `emailtemplate_snippets` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -255,5 +248,16 @@ CREATE TABLE IF NOT EXISTS `emailtemplate_template_items` (
CONSTRAINT `fk_titems_template` FOREIGN KEY (`template_id`) REFERENCES `emailtemplate_templates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- Tabelle: emailtemplate_template_usage
CREATE TABLE IF NOT EXISTS `emailtemplate_template_usage` (
`template_id` int(10) unsigned NOT NULL,
`customer_id` int(10) unsigned NOT NULL,
`render_count` int(10) unsigned NOT NULL DEFAULT 0,
`last_rendered_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`template_id`),
KEY `idx_usage_customer` (`customer_id`),
CONSTRAINT `fk_usage_template` FOREIGN KEY (`template_id`) REFERENCES `emailtemplate_templates` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
SET FOREIGN_KEY_CHECKS = 1;
-- Ende des Schema-Dumps
-- Ende des Schema-Dumps