Skip to content

Commit 2f97a8f

Browse files
committed
Database model changes
1 parent 8714ddb commit 2f97a8f

25 files changed

+1472
-15
lines changed

crates/data-model/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub use self::{
4949
user_agent::{DeviceType, UserAgent},
5050
users::{
5151
Authentication, AuthenticationMethod, BrowserSession, Password, User, UserEmail,
52-
UserEmailAuthentication, UserEmailAuthenticationCode, UserRecoverySession,
53-
UserRecoveryTicket, UserRegistration, UserRegistrationPassword,
52+
UserEmailAuthentication, UserEmailAuthenticationCode, UserPasskey, UserPasskeyChallenge,
53+
UserRecoverySession, UserRecoveryTicket, UserRegistration, UserRegistrationPassword,
5454
},
5555
};

crates/data-model/src/users.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ pub struct Authentication {
6969
pub enum AuthenticationMethod {
7070
Password { user_password_id: Ulid },
7171
UpstreamOAuth2 { upstream_oauth2_session_id: Ulid },
72+
Passkey { user_passkey_id: Ulid },
7273
Unknown,
7374
}
7475

@@ -217,3 +218,23 @@ pub struct UserRegistration {
217218
pub created_at: DateTime<Utc>,
218219
pub completed_at: Option<DateTime<Utc>>,
219220
}
221+
222+
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
223+
pub struct UserPasskey {
224+
pub id: Ulid,
225+
pub user_id: Ulid,
226+
pub credential_id: String,
227+
pub name: String,
228+
pub data: serde_json::Value,
229+
pub last_used_at: Option<DateTime<Utc>>,
230+
pub created_at: DateTime<Utc>,
231+
}
232+
233+
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
234+
pub struct UserPasskeyChallenge {
235+
pub id: Ulid,
236+
pub user_session_id: Option<Ulid>,
237+
pub state: serde_json::Value,
238+
pub created_at: DateTime<Utc>,
239+
pub completed_at: Option<DateTime<Utc>>,
240+
}

crates/storage-pg/.sqlx/query-041f1e8a7d43a085b4dc41fe9f7e83d3c4fd29f76b0dad1564a51840c3cfa7a8.json

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-182ff71d6007b3607761a48971e43b6bdf6a41896d787a13be3399022fe5e43d.json

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-66ec0c7a11d924c90c0d7232274bd19ee506edf085a143ba39fa4f6cb76d4b66.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-74e377397d05062d15b8b7a674390af5ecca2f977b8d74311b4cad401e2650e5.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-74f98b0965300fbd37c29e7d4fa02ffb44631d77b14796db971064ef27abb739.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-a216ece4185c813846fc844c558a1696f2daed7ae9e0c648fa297ddccecfc27e.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-a23cc4e35678d4421b998dfdba94d5215d39ea6d1390056c9e3ab0981673c84e.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/storage-pg/.sqlx/query-ab4faaeb099656b160a7e4b0324ea5812e8941c53e6acc4ecc030dcd6d5ed8fe.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)