Posted By

PixEye on 11/15/10


Tagged

mysql php timestamp symfony propel symfony12


Versions (?)

sf-refresh-propel-from-db.sh


 / Published in: Bash
 

This shell script helps to refresh a propel schema from an existing database using (the "old") Symfony 1.2 and avoiding the "CURRENT_TIMESTAMP" (MySQL) bug.

  1. #!/bin/sh
  2.  
  3. mv -f config/*.xml config/generated-schema.yml /tmp/
  4.  
  5. ./symfony propel-build-schema || exit $?
  6.  
  7. in='config/schema.yml'
  8. tmp='config/schema-new.yml'
  9. chnEnTrop=', required: true, defaultValue: CURRENT_TIMESTAMP'
  10. sed -e "s/$chnEnTrop//" "$in" > "$tmp" || exit $?
  11. mv -f "$tmp" "$in" || exit $?
  12.  
  13. ./symfony propel-build-model || exit $?
  14.  
  15. ./symfony propel:build-forms || exit $?
  16.  
  17. ./symfony propel:build-filters || exit $?

Report this snippet  

You need to login to post a comment.