-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: db issues beforesave and afterfind
- Loading branch information
1 parent
92c981a
commit 995924a
Showing
4 changed files
with
133 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
CREATE TABLE "subscriptions" (`id` integer,`relay_url` text,`webhook_url` text,`ids` json,`kinds` json,`authors` json,`tags` json,`since` datetime,`until` datetime,`limit` integer,`search` text,`open` boolean,`created_at` datetime,`updated_at` datetime,PRIMARY KEY (`id`)); | ||
CREATE TABLE "subscriptions" (`id` integer,`relay_url` text,`webhook_url` text,`ids_string` text,`kinds_string` text,`authors_string` text,`tags_string` text,`since` datetime,`until` datetime,`limit` integer,`search` text,`open` boolean,`created_at` datetime,`updated_at` datetime,PRIMARY KEY (`id`)); | ||
CREATE TABLE "request_events" (`id` integer,`subscription_id` integer,`nostr_id` text UNIQUE,`content` text,`state` text,`created_at` datetime,`updated_at` datetime,PRIMARY KEY (`id`),CONSTRAINT `fk_request_events_subscription` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions`(`id`) ON DELETE CASCADE); | ||
CREATE TABLE "response_events" (`id` integer,`subscription_id` integer,`request_id` integer,`nostr_id` text UNIQUE,`content` text,`replied_at` datetime,`created_at` datetime,`updated_at` datetime,PRIMARY KEY (`id`),CONSTRAINT `fk_response_events_subscription` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions`(`id`) ON DELETE CASCADE,CONSTRAINT `fk_response_events_request_event` FOREIGN KEY (`request_id`) REFERENCES `request_events`(`id`) ON DELETE CASCADE); |