Changes between Version 3 and Version 4 of WikiStart/DB


Ignore:
Timestamp:
03/22/25 15:27:33 (2 months ago)
Author:
203206
Comment:

db2

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart/DB

    v3 v4  
    66create table account(
    77    id serial primary key,
    8         username varchar(255) not null,
    9         password varchar(255) not null,
    10         balance decimal(15, 2) not null
     8    username varchar(255) not null,
     9    password varchar(255) not null,
     10    balance decimal(15, 2) not null
    1111);
    1212
    1313create table "transaction"(
    1414    id serial primary key,
    15         amount decimal(15, 2) not null,
    16         type varchar(50) not null,
    17         timestamp timestamp default current_timestamp,
    18         account_id int not null,
    19         foreign key (account_id) references account(id)
     15    amount decimal(15, 2) not null,
     16    type varchar(50) not null,
     17    timestamp timestamp default current_timestamp,
     18    account_id int not null,
     19    foreign key (account_id) references account(id)
    2020);
    2121
     
    3232create table deposit(
    3333    id serial primary key,
    34         account_id int not null,
    35         amount decimal(15,2) not null,
    36         timestamp timestamp default current_timestamp,
    37         foreign key(account_id) references account(id)
     34    account_id int not null,
     35    amount decimal(15,2) not null,
     36    timestamp timestamp default current_timestamp,
     37    foreign key(account_id) references account(id)
    3838);
    3939
    4040create table withdraw(
    4141    id serial primary key,
    42         account_id int not null,
    43         amount decimal(15,2) not null,
    44         timestamp timestamp default current_timestamp,
    45         foreign key(account_id) references account(id)
     42    account_id int not null,
     43    amount decimal(15,2) not null,
     44    timestamp timestamp default current_timestamp,
     45    foreign key(account_id) references account(id)
    4646);
    4747
    4848create table transferred_money(
    49         id serial primary key,
    50         s_account_id int not null,
    51         r_account_id int not null,
    52         t_id int not null,
    53         currency varchar(50) not null,
    54         foreign key (s_account_id) references account(id),
    55         foreign key (r_account_id) references account(id),
    56         foreign key (t_id) references transaction(id)
     49    id serial primary key,
     50    s_account_id int not null,
     51    r_account_id int not null,
     52    t_id int not null,
     53    currency varchar(50) not null,
     54    foreign key (s_account_id) references account(id),
     55    foreign key (r_account_id) references account(id),
     56    foreign key (t_id) references transaction(id)
    5757);
    5858