在调试EOL程序过程中难免由于处理意外出现数据关联或数据完整性的错误。下面的代码就是批量重新建立示例数据库的方法。
drop database eol_development;
drop database eol_data_development;
drop database eol_logging_development;
create database eol_development default charset=utf8;
create database eol_data_development default charset=utf8;
create database eol_logging_development default charset=utf8;
use eol_data_development;
RAILS_ENV=development rake db:migrate;
rake truncate RAILS_ENV=development; rake scenarios:load NAME=bootstrap RAILS_ENV=development —trace
drop database eol_test;
drop database eol_data_test;
drop database eol_logging_test;
create database eol_test default charset=utf8;
create database eol_data_test default charset=utf8;
create database eol_logging_test default charset=utf8;
use eol_data_test;