sf-refresh-propel-from-db.sh


/ Published in: Bash
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.