/ Published in: PHP
Takes a .sql file and runs trough that, each line as an update_sql.
Very usefull to track and migrate your blocks/views/cck etc changes.
Very usefull to track and migrate your blocks/views/cck etc changes.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Make these queries with mysqldump -uusernam -p database_name -t blocks -c --compact --skip-extended-insert | sort | uniq > sitese/all/modules/projectname_meta/blocks.sql **/ function projectname_meta_update_5002() { 'blocks' => 'blocks.sql', ); foreach($files as $table => $name) { $table = db_escape_string($table); $ret[] = update_sql('TRUNCATE {'. $table .'}'); foreach ($lines as $line_num => $line) { $ret[] = update_sql($line); } } } return $ret; }
URL: http://webschuur.com