Merge branch 'bankerweiterung_und_skonto'
[kivitendo-erp.git] / sql / Pg-upgrade2 / automatic_reconciliation.sql
diff --git a/sql/Pg-upgrade2/automatic_reconciliation.sql b/sql/Pg-upgrade2/automatic_reconciliation.sql
new file mode 100644 (file)
index 0000000..924fceb
--- /dev/null
@@ -0,0 +1,14 @@
+-- @tag: automatic_reconciliation
+-- @description: Erstellt Tabelle reconiliation_links für den automatischen Kontenabgleich.
+-- @depends: release_3_2_0 bank_transactions
+
+CREATE TABLE reconciliation_links (
+  id                      integer NOT NULL DEFAULT nextval('id'),
+  bank_transaction_id     integer NOT NULL,
+  acc_trans_id            bigint  NOT NULL,
+  rec_group               integer NOT NULL,
+
+  PRIMARY KEY (id),
+  FOREIGN KEY (bank_transaction_id)      REFERENCES bank_transactions (id),
+  FOREIGN KEY (acc_trans_id)             REFERENCES acc_trans (acc_trans_id)
+);