kivitendo/sql/Pg-upgrade2/bank_transactions.sql @ bf5e6c6a
6a12a968 | Niclas Zimmermann | -- @tag: bank_transactions
|
||
-- @description: Erstellen der Tabelle bank_transactions.
|
||||
15f58ff3 | Geoffrey Richardson | -- @depends: release_3_2_0 currencies
|
||
6a12a968 | Niclas Zimmermann | |||
CREATE TABLE bank_transactions (
|
||||
id SERIAL PRIMARY KEY,
|
||||
transaction_id INTEGER,
|
||||
remote_bank_code TEXT,
|
||||
remote_account_number TEXT,
|
||||
transdate DATE NOT NULL,
|
||||
valutadate DATE NOT NULL,
|
||||
amount numeric(15,5) NOT NULL,
|
||||
remote_name TEXT,
|
||||
purpose TEXT,
|
||||
invoice_amount numeric(15,5) DEFAULT 0,
|
||||
local_bank_account_id INTEGER NOT NULL,
|
||||
currency_id INTEGER NOT NULL,
|
||||
cleared BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
15f58ff3 | Geoffrey Richardson | itime TIMESTAMP DEFAULT now(),
|
||
6a12a968 | Niclas Zimmermann | FOREIGN KEY (currency_id) REFERENCES currencies (id),
|
||
FOREIGN KEY (local_bank_account_id) REFERENCES bank_accounts (id)
|
||||
);
|