Table accounts as A {
id bigserial [pk]
owner varchar [not null]
balance decimal [not null]
currency varchar [not null]
create_at timestamptz [not null, default: `now()`]
indexes {
owner
}
}
Table entries {
id bigserial [pk]
account_id bigint [not null, ref: > A.id]
amount decimal [not null, note:'can be negative or positive']
create_at timestamptz [not null,default: `now()`]
indexes {
account_id
}
}
Table transfers {
id bigserial [pk]
from_account_id bigint [not null, ref: > A.id]
to_account_id bigint [not null, ref: > A.id]
amount decimal [not null, note:'must be positive']
create_at timestamptz [not null, default: `now()`]
indexes {
from_account_id
to_account_id
(from_account_id, to_account_id)
}
}
-
Notifications
You must be signed in to change notification settings - Fork 0
piriya-muaithaisong/Simple-Bank
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published