fuck off, I call that a day.
This commit is contained in:
1 parent
04d4d1b7a9
commit
cb5805a829
12 files changed
+229
-86
No files matched your search
@@ -65,15 +65,18 @@ CREATE TABLE IF NOT EXISTS cashed_cheques
|
||||
(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
drawer_user_id INTEGER NOT NULL,
|
||||
drawer_account_id INTEGER,
|
||||
drawer_account_id INTEGER NOT NULL,
|
||||
cheque_number INTEGER NOT NULL,
|
||||
amount INTEGER NOT NULL,
|
||||
underlying_security INTEGER NOT NULL,
|
||||
payee_user_id INTEGER NOT NULL,
|
||||
payee_account_id INTEGER NOT NULL,
|
||||
creation_time DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
|
||||
FOREIGN KEY (underlying_security) REFERENCES securities (id),
|
||||
FOREIGN KEY (drawer_user_id) REFERENCES users (id),
|
||||
FOREIGN KEY (drawer_account_id) REFERENCES accounts (id),
|
||||
FOREIGN KEY (payee_user_id) REFERENCES users (id),
|
||||
FOREIGN KEY (payee_account_id) REFERENCES accounts (id),
|
||||
CONSTRAINT double_spending UNIQUE (drawer_user_id, cheque_number) -- no double spending
|
||||
);
|
||||
Reference in new issue
Block a user