-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Persistent store and forward (#1680)
Merge pull request #1680 Persistent store and forward
- Loading branch information
Showing
42 changed files
with
1,874 additions
and
353 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# For documentation on how to configure this file, | ||
# see diesel.rs/guides/configuring-diesel-cli | ||
|
||
[print_schema] | ||
file = "src/schema.rs" |
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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DROP TABLE IF EXISTS stored_messages; | ||
DROP TABLE IF EXISTS dht_settings; |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
CREATE TABLE stored_messages ( | ||
id INTEGER NOT NULL PRIMARY KEY, | ||
version INT NOT NULL, | ||
origin_pubkey TEXT NOT NULL, | ||
origin_signature TEXT NOT NULL, | ||
message_type INT NOT NULL, | ||
destination_pubkey TEXT, | ||
destination_node_id TEXT, | ||
header BLOB NOT NULL, | ||
body BLOB NOT NULL, | ||
is_encrypted BOOLEAN NOT NULL CHECK (is_encrypted IN (0,1)), | ||
priority INT NOT NULL, | ||
stored_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP | ||
); | ||
|
||
CREATE INDEX idx_stored_messages_destination_pubkey ON stored_messages (destination_pubkey); | ||
CREATE INDEX idx_stored_messages_destination_node_id ON stored_messages (destination_node_id); | ||
CREATE INDEX idx_stored_messages_stored_at ON stored_messages (stored_at); | ||
CREATE INDEX idx_stored_messages_priority ON stored_messages (priority); | ||
|
||
CREATE TABLE dht_settings ( | ||
id INTEGER PRIMARY KEY NOT NULL, | ||
key TEXT NOT NULL, | ||
value BLOB NOT NULL | ||
); | ||
|
||
CREATE UNIQUE INDEX idx_dht_settings_key ON dht_settings (key); |
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
Oops, something went wrong.