X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/4b7f17c8d92bff2e9f495d476a650dc3897c3097..a87694dc525b4eabff11029f1e5401621e2bd3bc:/sql/Pg-upgrade2/bank_transactions.sql?ds=inline

diff --git a/sql/Pg-upgrade2/bank_transactions.sql b/sql/Pg-upgrade2/bank_transactions.sql
new file mode 100644
index 000000000..6e9f91766
--- /dev/null
+++ b/sql/Pg-upgrade2/bank_transactions.sql
@@ -0,0 +1,22 @@
+-- @tag: bank_transactions
+-- @description: Erstellen der Tabelle bank_transactions.
+-- @depends: release_3_2_0 currencies
+
+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,
+  itime TIMESTAMP DEFAULT now(),
+  FOREIGN KEY (currency_id)            REFERENCES currencies (id),
+  FOREIGN KEY (local_bank_account_id)  REFERENCES bank_accounts (id)
+);
