generate model and migrate data