Ignore:
Timestamp:
May 12, 2012, 8:39:25 PM (9 years ago)
Author:
teymour
Message:

Ajout d'un champ pour les amendements multiples (+correction bug rectifié)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/bin/updateDB5.sh

    r2672 r2674  
    11. bin/db.inc
     2
    23echo 'ALTER TABLE amendement ADD sous_amendement_de VARCHAR(8) NOT NULL AFTER numero' | mysql $MYSQLID $DBNAME
    34echo 'select a.id, a.texteloi_id, a.numero, t.triple_value from amendement a, tagging tg, tag t WHERE a.sort <> "Rectifié" and a.id = tg.taggable_id AND t.id = tg.tag_id AND t.triple_key = "sous_amendement_de"' |  mysql $MYSQLID $DBNAME | grep ^[0-9] | sed 's/\([A-F]\)\t/;\1;/'| sed 's/\t/;;/g' | awk -F';' '{print $1";"$3";"$5$6";"$7$6}'|awk -F';' '{print "update amendement set sous_amendement_de = \""$4"\" where id = "$1";"}' | mysql $MYSQLID $DBNAME
     5
     6echo 'ALTER TABLE amendement ADD nb_multiples INT NOT NULL DEFAULT 1 AFTER content_md5 ' | mysql $MYSQLID $DBNAME
     7echo 'select a.id, count(tg.id) FROM tagging tg LEFT JOIN amendement a ON a.id = tg.taggable_id LEFT JOIN tag t ON t.id = tg.tag_id  WHERE a.sort <> "Rectifié" AND t.triple_key = "amendement" AND taggable_model = "Amendement" group by a.id' |  mysql $MYSQLID $DBNAME | grep ^[0-9]  | awk '{print "UPDATE amendement SET nb_multiples = "$2" WHERE id = "$1";"}'  | mysql $MYSQLID $DBNAME
     8
    49php symfony doctrine:build-model
Note: See TracChangeset for help on using the changeset viewer.