diff --git a/packages/document/dbml/emumet.dbml b/packages/document/dbml/emumet.dbml index 6fbdf25..b91a4ff 100644 --- a/packages/document/dbml/emumet.dbml +++ b/packages/document/dbml/emumet.dbml @@ -16,6 +16,7 @@ Table accounts { deleted_at TIMESTAMPTZ version UUID [not null] nanoid TEXT [not null, unique] + created_at TIMESTAMPTZ [not null] } Table remote_accounts { @@ -53,31 +54,29 @@ Table metadatas { Ref: metadatas.account_id > accounts.id [delete: cascade] -Table stellar_hosts { +Table auth_hosts { id UUID [not null, pk] url TEXT [not null, unique] } -Table stellar_accounts { +Table auth_accounts { id UUID [not null, pk] host_id UUID [not null] client_id TEXT [not null] - access_token TEXT [not null] - refresh_token TEXT [not null] version UUID [not null] } -Ref: stellar_accounts.host_id > stellar_hosts.id [delete: cascade] +Ref: auth_accounts.host_id > auth_hosts.id [delete: cascade] -Table stellar_emumet_accounts { +Table auth_emumet_accounts { emumet_id UUID [not null] - stellar_id UUID [not null, ref: > stellar_accounts.id] + auth_id UUID [not null, ref: > auth_accounts.id] Indexes { - (emumet_id, stellar_id) [pk] + (emumet_id, auth_id) [pk] } } -Ref: stellar_emumet_accounts.emumet_id > accounts.id [delete: cascade] +Ref: auth_emumet_accounts.emumet_id > accounts.id [delete: cascade] Table follows { id UUID [not null, pk] @@ -107,14 +106,14 @@ Table images { // } // // Table moderators { -// stellar_id UUID [not null, pk, ref: > stellar_accounts.id] +// auth_id UUID [not null, pk, ref: > auth_accounts.id] // role_id UUID [not null, pk, ref: > moderator_roles.id] // } // // Table account_reports { // id UUID [not null, pk] // target_id UUID [not null, ref: > accounts.id] -// reported_id UUID [not null, ref: > stellar_accounts.id] +// reported_id UUID [not null, ref: > auth_accounts.id] // type TEXT [not null] // comment TEXT [not null] // created_at TIMESTAMPTZ [not null] @@ -125,7 +124,7 @@ Table images { // Table account_moderations { // id UUID [not null, pk] // target_id UUID [not null, ref: > accounts.id] -// moderator_id UUID [not null, ref: > stellar_accounts.id] +// moderator_id UUID [not null, ref: > auth_accounts.id] // type TEXT [not null] // comment TEXT [not null] // created_at TIMESTAMPTZ [not null] @@ -139,17 +138,17 @@ Table images { // } // } // -// Table stellar_account_moderations { +// Table auth_account_moderations { // id UUID [not null, pk] -// target_id UUID [not null, ref: > stellar_accounts.id] -// moderator_id UUID [not null, ref: > stellar_accounts.id] +// target_id UUID [not null, ref: > auth_accounts.id] +// moderator_id UUID [not null, ref: > auth_accounts.id] // type TEXT [not null] // comment TEXT [not null] // created_at TIMESTAMPTZ [not null] // closed_at TIMESTAMPTZ // } -// Table stellar_account_moderation_reports { -// moderation_id UUID [not null, ref: > stellar_account_moderations.id] +// Table auth_account_moderation_reports { +// moderation_id UUID [not null, ref: > auth_account_moderations.id] // report_id UUID [not null, ref: > account_reports.id] // Indexes { // (moderation_id, report_id) [pk] @@ -158,8 +157,8 @@ Table images { // // Table host_moderations { // id UUID [not null, pk] -// host_id UUID [not null, ref: > stellar_hosts.id] -// moderator_id UUID [not null, ref: > stellar_accounts.id] +// host_id UUID [not null, ref: > auth_hosts.id] +// moderator_id UUID [not null, ref: > auth_accounts.id] // type TEXT [not null] // comment TEXT [not null] // created_at TIMESTAMPTZ [not null] diff --git a/packages/document/static/dbml/emumet.dbml.svg b/packages/document/static/dbml/emumet.dbml.svg index 41f0f7f..cb49919 100644 --- a/packages/document/static/dbml/emumet.dbml.svg +++ b/packages/document/static/dbml/emumet.dbml.svg @@ -4,495 +4,489 @@ - - + + dbml event_streams - - - -       event_streams        - - -version -     -UUID - -(!) - - -id -     -UUID - -(!) - - -event_name     -TEXT - -(!) - - -data     -JSON - -(!) - + + + +       event_streams        + + +version +     +UUID + +(!) + + +id +     +UUID + +(!) + + +event_name     +TEXT + +(!) + + +data     +JSON + +(!) + accounts - - - -       accounts        - - -id -     -UUID - - -name     -TEXT - -(!) - - -private_key     -TEXT - -(!) - - -public_key     -TEXT - -(!) - - -is_bot     -BOOLEAN - -(!) - - -deleted_at     -TIMESTAMPTZ - - -version     -UUID - -(!) - - -nanoid     -TEXT - -(!) - + + + +       accounts        + + +id +     +UUID + + +name     +TEXT + +(!) + + +private_key     +TEXT + +(!) + + +public_key     +TEXT + +(!) + + +is_bot     +BOOLEAN + +(!) + + +deleted_at     +TIMESTAMPTZ + + +version     +UUID + +(!) + + +nanoid     +TEXT + +(!) + + +created_at     +TIMESTAMPTZ + +(!) + profiles - - - -       profiles        - - -id -     -UUID - -(!) - - -account_id     -UUID - -(!) - - -display     -TEXT - - -summary     -TEXT - - -icon_id     -UUID - - -banner_id     -UUID - - -version     -UUID - -(!) - - -nanoid     -TEXT - -(!) - + + + +       profiles        + + +id +     +UUID + +(!) + + +account_id     +UUID + +(!) + + +display     +TEXT + + +summary     +TEXT + + +icon_id     +UUID + + +banner_id     +UUID + + +version     +UUID + +(!) + + +nanoid     +TEXT + +(!) + accounts:e->profiles:w - - -1 -1 + + +1 +1 remote_accounts - - - -       remote_accounts        - - -id -     -UUID - -(!) - - -acct     -TEXT - -(!) - - -url     -TEXT - -(!) - - -icon_id     -UUID - + + + +       remote_accounts        + + +id +     +UUID + +(!) + + +acct     +TEXT + +(!) + + +url     +TEXT + +(!) + + +icon_id     +UUID + images - - - -       images        - - -id -     -UUID - -(!) - - -url     -TEXT - -(!) - - -hash     -TEXT - -(!) - - -blurhash     -TEXT - -(!) - + + + +       images        + + +id +     +UUID + +(!) + + +url     +TEXT + +(!) + + +hash     +TEXT + +(!) + + +blurhash     +TEXT + +(!) + remote_accounts:e->images:w - - -1 -* + + +1 +* profiles:e->images:w - - -1 -* + + +1 +* profiles:e->images:w - - -1 -* + + +1 +* metadatas - - - -       metadatas        - - -id -     -UUID - -(!) - - -account_id     -UUID - -(!) - - -label     -TEXT - -(!) - - -content     -TEXT - -(!) - - -version     -UUID - -(!) - - -nanoid     -TEXT - -(!) - + + + +       metadatas        + + +id +     +UUID + +(!) + + +account_id     +UUID + +(!) + + +label     +TEXT + +(!) + + +content     +TEXT + +(!) + + +version     +UUID + +(!) + + +nanoid     +TEXT + +(!) + metadatas:e->accounts:w - - -1 -* + + +1 +* - - -stellar_hosts - - - -       stellar_hosts        - - -id -     -UUID - -(!) - - -url     -TEXT - -(!) - + + +auth_hosts + + + +       auth_hosts        + + +id +     +UUID + +(!) + + +url     +TEXT + +(!) + - - -stellar_accounts - - - -       stellar_accounts        - - -id -     -UUID - -(!) - - -host_id     -UUID - -(!) - - -client_id     -TEXT - -(!) - - -access_token     -TEXT - -(!) - - -refresh_token     -TEXT - -(!) - - -version     -UUID - -(!) - + + +auth_accounts + + + +       auth_accounts        + + +id +     +UUID + +(!) + + +host_id     +UUID + +(!) + + +client_id     +TEXT + +(!) + + +version     +UUID + +(!) + - - + + -stellar_accounts:e->stellar_hosts:w - - -1 -* +auth_accounts:e->auth_hosts:w + + +1 +* - - -stellar_emumet_accounts - - - -       stellar_emumet_accounts        - - -emumet_id -     -UUID - -(!) - - -stellar_id -     -UUID - -(!) - + + +auth_emumet_accounts + + + +       auth_emumet_accounts        + + +emumet_id +     +UUID + +(!) + + +auth_id +     +UUID + +(!) + - - + + -stellar_emumet_accounts:e->accounts:w - - -1 -* +auth_emumet_accounts:e->accounts:w + + +1 +* - - + + -stellar_emumet_accounts:e->stellar_accounts:w - - -1 -* +auth_emumet_accounts:e->auth_accounts:w + + +1 +* follows - - - -       follows        - - -id -     -UUID - -(!) - - -follower_local_id     -UUID - - -follower_remote_id     -UUID - - -followee_local_id     -UUID - - -followee_remote_id     -UUID - - -approved_at     -TIMESTAMPTZ - + + + +       follows        + + +id +     +UUID + +(!) + + +follower_local_id     +UUID + + +follower_remote_id     +UUID + + +followee_local_id     +UUID + + +followee_remote_id     +UUID + + +approved_at     +TIMESTAMPTZ + follows:e->accounts:w - - -1 -* + + +1 +* follows:e->accounts:w - - -1 -* + + +1 +* follows:e->remote_accounts:w - - -1 -* + + +1 +* follows:e->remote_accounts:w - - -1 -* + + +1 +*