1 -- @tag: bank_transactions
 
   2 -- @description: Erstellen der Tabelle bank_transactions.
 
   3 -- @depends: release_3_2_0 currencies
 
   5 CREATE TABLE bank_transactions (
 
   7   transaction_id INTEGER,
 
   9   remote_account_number TEXT,
 
  10   transdate DATE NOT NULL,
 
  11   valutadate DATE NOT NULL,
 
  12   amount numeric(15,5) NOT NULL,
 
  15   invoice_amount numeric(15,5) DEFAULT 0,
 
  16   local_bank_account_id INTEGER NOT NULL,
 
  17   currency_id INTEGER NOT NULL,
 
  18   cleared BOOLEAN NOT NULL DEFAULT FALSE,
 
  19   itime TIMESTAMP DEFAULT now(),
 
  20   FOREIGN KEY (currency_id)            REFERENCES currencies (id),
 
  21   FOREIGN KEY (local_bank_account_id)  REFERENCES bank_accounts (id)