forked from magic-wormhole/magic-wormhole-transit-relay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade usagedb-v1 to v2 (with client-version table)
- Loading branch information
Showing
3 changed files
with
50 additions
and
25 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
19 changes: 19 additions & 0 deletions
19
src/wormhole_mailbox_server/db-schemas/upgrade-usage-to-v2.sql
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,19 @@ | ||
CREATE TABLE `client_versions` | ||
( | ||
`app_id` VARCHAR, | ||
`side` VARCHAR, -- for deduplication of reconnects | ||
`connect_time` INTEGER, -- seconds since epoch, rounded to "blur time" | ||
-- the client sends us a 'client_version' tuple of (implementation, version) | ||
-- the Python client sends e.g. ("python", "0.11.0") | ||
`implementation` VARCHAR, | ||
`version` VARCHAR | ||
); | ||
CREATE INDEX `client_versions_time_idx` on `client_versions` (`connect_time`); | ||
CREATE INDEX `client_versions_appid_time_idx` on `client_versions` (`app_id`, `connect_time`); | ||
|
||
DROP TABLE `version`; | ||
CREATE TABLE `version` | ||
( | ||
`version` INTEGER -- contains one row, set to 2 | ||
); | ||
INSERT INTO `version` (`version`) VALUES (2); |
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