save oauth user_id and link users and accounts

This commit is contained in:
2025-12-30 02:06:14 -07:00
parent bc592718bf
commit 8090a6f25e
21 changed files with 468 additions and 198 deletions
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 48 KiB

+42
View File
@@ -7,6 +7,7 @@ entity "**accounts**" {
--
*""email"": //text //
*""verified"": //boolean //
*""user_id"": //text [FK]//
}
entity "**etsy_access_tokens**" {
@@ -18,6 +19,14 @@ entity "**etsy_access_tokens**" {
*""refresh_token_expiration"": //timestamp with time zone //
}
entity "**etsy_oauth_requests**" {
+ ""state"": //bytea [PK]//
--
*""code_verifier"": //bytea //
*""expiration"": //timestamp with time zone //
*""account_id"": //integer [FK]//
}
entity "**etsy_store_events**" {
+ ""store_id"": //text [PK][FK]//
+ ""event_timestamp"": //timestamp with time zone [PK][FK]//
@@ -33,6 +42,33 @@ entity "**etsy_users**" {
*""shop_id"": //integer //
}
entity "**oauth_login_states**" {
+ ""state"": //bytea [PK]//
--
*""expiration"": //timestamp with time zone //
}
entity "**oauth_tokens**" {
+ ""access_token"": //text [PK]//
--
*""token_type"": //text //
*""refresh_token"": //text //
*""expiry"": //timestamp with time zone //
*""id_token_issuer"": //text //
*""id_token_audience"": //text[] //
*""id_token_subject"": //text [FK]//
*""id_token_expiry"": //timestamp with time zone //
*""id_token_issued_at"": //timestamp with time zone //
*""id_token_nonce"": //text //
*""id_token_access_token_hash"": //text //
*""claims"": //jsonb //
}
entity "**oauth_users**" {
+ ""user_id"": //text [PK]//
--
}
entity "**raw_store_events**" {
+ ""platform"": //text [PK]//
+ ""store_id"": //text [PK]//
@@ -64,8 +100,12 @@ entity "**wix_store_events**" {
*""platform"": //text [FK]//
}
"**accounts**" }-- "**oauth_users**"
"**etsy_access_tokens**" ||-|| "**etsy_users**"
"**etsy_oauth_requests**" }-- "**accounts**"
"**etsy_store_events**" }-- "**raw_store_events**"
"**etsy_store_events**" }-- "**raw_store_events**"
@@ -76,6 +116,8 @@ entity "**wix_store_events**" {
"**etsy_users**" }-- "**accounts**"
"**oauth_tokens**" }-- "**oauth_users**"
"**tiktok_store_events**" }-- "**raw_store_events**"
"**tiktok_store_events**" }-- "**raw_store_events**"