-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for the syn2mas
SynapseReader
- Loading branch information
1 parent
54b718b
commit 81a15c7
Showing
4 changed files
with
118 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
-- | ||
INSERT INTO users | ||
( | ||
name, | ||
password_hash, | ||
creation_ts, | ||
admin, | ||
upgrade_ts, | ||
is_guest, | ||
appservice_id, | ||
consent_version, | ||
consent_server_notice_sent, | ||
user_type, | ||
deactivated, | ||
shadow_banned, | ||
consent_ts, | ||
approved, | ||
locked, | ||
suspended | ||
) | ||
VALUES | ||
( | ||
'@alice:example.com', | ||
'$2b$12$aaa/aaaaaaaaaa.aaaaaaaaaaaaaaa./aaaaaaaaaaaaaaaaaaa/A', | ||
1530393962, | ||
0, | ||
NULL, | ||
0, | ||
NULL, | ||
'1.0', | ||
'1.0', | ||
NULL, | ||
0, | ||
NULL, | ||
NULL, | ||
NULL, | ||
false, | ||
false | ||
); | ||
|
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
23 changes: 23 additions & 0 deletions
23
crates/syn2mas/src/synapse_reader/snapshots/syn2mas__synapse_reader__test__read_users.snap
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,23 @@ | ||
--- | ||
source: crates/syn2mas/src/synapse_reader/mod.rs | ||
expression: users | ||
--- | ||
{ | ||
SynapseUser { | ||
name: FullUserId( | ||
"@alice:example.com", | ||
), | ||
password_hash: Some( | ||
"$2b$12$aaa/aaaaaaaaaa.aaaaaaaaaaaaaaa./aaaaaaaaaaaaaaaaaaa/A", | ||
), | ||
admin: SynapseBool( | ||
false, | ||
), | ||
deactivated: SynapseBool( | ||
false, | ||
), | ||
creation_ts: SecondsTimestamp( | ||
2018-06-30T21:26:02Z, | ||
), | ||
}, | ||
} |
26 changes: 26 additions & 0 deletions
26
crates/syn2mas/test_synapse_migrations/20250117064958_users.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,26 @@ | ||
-- Copyright 2025 New Vector Ltd. | ||
-- | ||
-- SPDX-License-Identifier: AGPL-3.0-only | ||
-- Please see LICENSE in the repository root for full details. | ||
|
||
-- Brings in the `users` table from Synapse | ||
|
||
CREATE TABLE users ( | ||
name text, | ||
password_hash text, | ||
creation_ts bigint, | ||
admin smallint DEFAULT 0 NOT NULL, | ||
upgrade_ts bigint, | ||
is_guest smallint DEFAULT 0 NOT NULL, | ||
appservice_id text, | ||
consent_version text, | ||
consent_server_notice_sent text, | ||
user_type text, | ||
deactivated smallint DEFAULT 0 NOT NULL, | ||
shadow_banned boolean, | ||
consent_ts bigint, | ||
approved boolean, | ||
locked boolean DEFAULT false NOT NULL, | ||
suspended boolean DEFAULT false NOT NULL | ||
); | ||
|