Angebote: neue Felder Auftragswahrscheinlichkeit, Voraus. Abrechnungsdatum
[kivitendo-erp.git] / sql / Pg-upgrade2 / sales_quotation_order_probability_expected_billing_date.sql
diff --git a/sql/Pg-upgrade2/sales_quotation_order_probability_expected_billing_date.sql b/sql/Pg-upgrade2/sales_quotation_order_probability_expected_billing_date.sql
new file mode 100644 (file)
index 0000000..5c37168
--- /dev/null
@@ -0,0 +1,12 @@
+-- @tag: sales_quotation_order_probability_expected_billing_date
+-- @charset: utf-8
+-- @description: Weitere Felder im Angebot: Angebotswahrscheinlichkeit, voraussichtliches Abrechnungsdatum
+ALTER TABLE oe
+  ADD COLUMN order_probability     INTEGER,
+  ADD COLUMN expected_billing_date DATE;
+
+UPDATE oe SET order_probability = 0;
+
+ALTER TABLE oe
+  ALTER COLUMN order_probability SET DEFAULT 0,
+  ALTER COLUMN order_probability SET NOT NULL;