improve migration scripts