noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 67/107: SQL : add constraint for payment_meth


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 67/107: SQL : add constraint for payment_method
Date: Mon, 26 Aug 2019 10:32:01 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit ae523e6c2abed322cb3f358f691e21baf57d0bff
Author: Dany De Bontridder <address@hidden>
Date:   Tue Aug 6 22:01:25 2019 +0200

    SQL : add constraint for payment_method
---
 sql/upgrade.sql | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index 3d2788c..ea4b131 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -14,3 +14,8 @@ insert into type_payment_ref (id,tp_description) values 
('CACRD','Carte de créd
                                                         ('CASH','Liquide'),
                                                         
('ELECT','Electronique'),
                                                         ('VIRT','Virement');
+update payment_method set type_payment_id = 'VIRT';
+
+alter table payment_method add constraint type_payment_ref_fk foreign key 
(type_payment_id) references type_payment_ref(id);
+
+alter table payment_method alter type_payment_id set not null;
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]