Files
2026-01-08 01:15:07 +00:00

39 lines
1.1 KiB
Plaintext

Project simple_bank {
database_type: 'PostgreSQL'
Note: '''
# Simple Bank Database
'''
}
Table users as U {
username varchar [pk]
role varchar [not null, default: 'member']
hashed_password varchar [not null]
full_name varchar [not null]
email varchar [unique, not null]
is_email_verified bool [not null, default: false]
password_changed_at timestamptz [not null, default: '0001-01-01']
created_at timestamptz [not null, default: `now()`]
}
Table verify_emails {
id bigserial [pk]
username varchar [ref: > U.username, not null]
email varchar [not null]
secret_code varchar [not null]
is_used bool [not null, default: false]
created_at timestamptz [not null, default: `now()`]
expired_at timestamptz [not null, default: `now() + interval '15 minutes'`]
}
Table sessions {
id uuid [pk]
username varchar [ref: > U.username, not null]
refresh_token varchar [not null]
user_agent varchar [not null]
client_ip varchar [not null]
is_blocked boolean [not null, default: false]
expires_at timestamptz [not null]
created_at timestamptz [not null, default: `now()`]
}