Method: ActiveRecord::Tasks::MySQLDatabaseTasks#structure_load

Defined in:
lib/active_record/tasks/mysql_database_tasks.rb

#structure_load(filename, extra_flags) ⇒ Object



61
62
63
64
65
66
67
68
# File 'lib/active_record/tasks/mysql_database_tasks.rb', line 61

def structure_load(filename, extra_flags)
  args = prepare_command_options
  args.concat(["--execute", %{SET FOREIGN_KEY_CHECKS = 0; SOURCE #{filename}; SET FOREIGN_KEY_CHECKS = 1}])
  args.concat(["--database", db_config.database.to_s])
  args.unshift(*extra_flags) if extra_flags

  run_cmd("mysql", args, "loading")
end