2
2
-- create "messages" table
3
3
CREATE TABLE `messages ` (` id` integer NOT NULL PRIMARY KEY AUTOINCREMENT, ` from` text NOT NULL , ` to` json NOT NULL , ` subject` text NOT NULL , ` text` text NOT NULL , ` html` text NOT NULL , ` date` datetime NOT NULL , ` created_at` datetime NOT NULL );
4
4
-- create "attachments" table
5
- CREATE TABLE `attachments ` (` id` integer NOT NULL PRIMARY KEY AUTOINCREMENT, ` message_id` integer NULL , ` name` text NOT NULL , ` mime` text NOT NULL , ` extension` text NOT NULL , CONSTRAINT ` message_id` FOREIGN KEY (` message_id` ) REFERENCES ` messages` (` id` ) ON UPDATE NO ACTION ON DELETE SET NULL );
5
+ CREATE TABLE `attachments ` (` id` integer NOT NULL PRIMARY KEY AUTOINCREMENT, ` message_id` integer NULL , ` name` text NOT NULL , ` mime` text NOT NULL , ` extension` text NOT NULL , CONSTRAINT ` message_id` FOREIGN KEY (` message_id` ) REFERENCES ` messages` (` id` ) ON UPDATE CASCADE ON DELETE SET NULL );
6
6
-- create "endpoints" table
7
7
CREATE TABLE `endpoints ` (` id` integer NOT NULL PRIMARY KEY AUTOINCREMENT, ` internal` boolean NOT NULL , ` internal_id` text NULL , ` name` text NOT NULL , ` attachment_disable` boolean NOT NULL , ` text_disable` boolean NOT NULL , ` title_template` text NOT NULL , ` body_template` text NOT NULL , ` kind` text NOT NULL , ` config` json NOT NULL , ` updated_at` datetime NOT NULL , ` created_at` datetime NOT NULL );
8
8
-- create index "endpoints_internal_id_idx" to table: "endpoints"
@@ -12,7 +12,7 @@ CREATE TABLE `rules` (`id` integer NOT NULL PRIMARY KEY AUTOINCREMENT, `internal
12
12
-- create index "rules_internal_id_idx" to table: "rules"
13
13
CREATE UNIQUE INDEX `rules_internal_id_idx ` ON ` rules` (` internal_id` );
14
14
-- create "rules_to_endpoints" table
15
- CREATE TABLE `rules_to_endpoints ` (` internal` boolean NOT NULL , ` rule_id` integer NOT NULL , ` endpoint_id` integer NOT NULL , CONSTRAINT ` endpoint_id` FOREIGN KEY (` endpoint_id` ) REFERENCES ` endpoints` (` id` ) ON UPDATE NO ACTION ON DELETE CASCADE , CONSTRAINT ` rule_id` FOREIGN KEY (` rule_id` ) REFERENCES ` rules` (` id` ) ON UPDATE NO ACTION ON DELETE CASCADE );
15
+ CREATE TABLE `rules_to_endpoints ` (` internal` boolean NOT NULL , ` rule_id` integer NOT NULL , ` endpoint_id` integer NOT NULL , CONSTRAINT ` endpoint_id` FOREIGN KEY (` endpoint_id` ) REFERENCES ` endpoints` (` id` ) ON UPDATE CASCADE ON DELETE CASCADE , CONSTRAINT ` rule_id` FOREIGN KEY (` rule_id` ) REFERENCES ` rules` (` id` ) ON UPDATE CASCADE ON DELETE CASCADE );
16
16
-- create index "rules_to_endpoints_rule_id_endpoint_id_idx" to table: "rules_to_endpoints"
17
17
CREATE UNIQUE INDEX `rules_to_endpoints_rule_id_endpoint_id_idx ` ON ` rules_to_endpoints` (` rule_id` , ` endpoint_id` );
18
18
-- create "traces" table
0 commit comments