mermaid: update

This commit is contained in:
2025-11-06 06:51:21 +01:00
parent af35478749
commit d21e07f5ad
2 changed files with 64 additions and 5 deletions

View File

@@ -87,10 +87,10 @@ erDiagram
int person_id FK int person_id FK
} }
%% Relations %% Relations
person ||--o{ holder : "is held by" person ||--|| holder
company ||--o{ holder : "is held by" company ||--|| holder
``` ```
## 2. Les comptes ## 2. Les comptes
@@ -122,6 +122,66 @@ begin;
commit; commit;
``` ```
```mermaid
erDiagram
person {
bigint id PK
text firstname
text lastname
date birthdate
}
company {
bigint id PK
text registration_numer
date creation_date
}
bank {
bigint id PK
}
holder {
bigint id PK
date creation_date
}
account {
bigint id PK
date creation_date
decimal balance >0
text currency_code FK
}
account_holder {
bigint account_id FK
bigint holder_id FK
}
transaction {
bigint id PK
date transaction_date
decimal amount
}
currency {
text code PK
}
currency {
text code PK
}
%% Relations
person ||--|| holder
company ||--|| holder
bank ||--|| holder
holder }|--|{ account_holder
account_holder }|--|{ account
```
## 4. Procédure stockée ## 4. Procédure stockée
Pour fiabiliser le process et être sûr que l'execution s'effectue toujours dans une transaction, Pour fiabiliser le process et être sûr que l'execution s'effectue toujours dans une transaction,

View File

@@ -98,7 +98,6 @@ create table account (
id bigint primary key generated always as identity, id bigint primary key generated always as identity,
number text unique not null, number text unique not null,
opened_at date not null default current_date, opened_at date not null default current_date,
closed_at date,
balance numeric(18,6) not null default 0 check (balance >= 0) balance numeric(18,6) not null default 0 check (balance >= 0)
); );