From 6433278f065309de4b4c8a422a769f1a7fff91ed Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 22 Nov 2013 14:10:24 +0100 Subject: [PATCH] [this_is_dirty] Avec des variables, c'est nettement plus facile --- bde/this_is_dirty.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bde/this_is_dirty.sh b/bde/this_is_dirty.sh index cec4131..cb72f58 100755 --- a/bde/this_is_dirty.sh +++ b/bde/this_is_dirty.sh @@ -1,12 +1,20 @@ #!/bin/bash -#psql bde -c "ALTER TABLE transactions DISABLE TRIGGER ALL;" #psql bde -c "INSERT INTO transactions (conso, emetteur, destinataire, montant, quantite, valide, remarque) VALUES (1, 2850, 0, 35, 1, true, 'sweat ENS Z');" #psql bde -c "INSERT INTO transactions (conso, emetteur, destinataire, montant, quantite, valide, remarque) VALUES (1, 3246, 3539, 94.72, 1, true, 'Pot A♡');" #psql bde -c "INSERT INTO transactions (date, conso, emetteur, destinataire, montant, quantite, valide, remarque) VALUES ('2013-01-17 00:14:56', 44, 2822, 0, 2.00, 6, true, 'Pinte');" + +#psql bde -c "ALTER TABLE transactions DISABLE TRIGGER ALL;" #psql bde -c "ALTER TABLE transactions ENABLE TRIGGER ALL;" +connard=2187 +recepteur=2798 +quantite=1 +taxe=3.00 +randomreason='Sauce - Menu' -psql bde -c "INSERT INTO transactions (conso, emetteur, destinataire, montant, quantite, valide, remarque) VALUES (1, 1814, 0, 39.85, 1, true, 'Vidage de note');" +psql bde -c "UPDATE adherents SET solde=solde + 500 WHERE numcbde = ${connard};" +psql bde -c "INSERT INTO transactions (conso, emetteur, destinataire, montant, quantite, valide, remarque) VALUES (1, ${connard}, ${recepteur}, ${taxe}, ${quantite}, true, '${randomreason}');" +psql bde -c "UPDATE adherents SET solde=solde - 500 WHERE numcbde = ${connard};" -- 2.39.2