Added Package.migration_execute to execute all pending package migrations at once.
This commit is contained in:
parent
2137250bae
commit
2ac873886e
1 changed files with 16 additions and 0 deletions
|
@ -361,6 +361,22 @@ returns
|
||||||
record
|
record
|
||||||
end
|
end
|
||||||
|
|
||||||
|
=begin
|
||||||
|
|
||||||
|
execute all pending package migrations at once
|
||||||
|
|
||||||
|
Package.migration_execute
|
||||||
|
|
||||||
|
=end
|
||||||
|
|
||||||
|
def self.migration_execute
|
||||||
|
Package.all.each {|package|
|
||||||
|
json_file = Package._get_bin(package.name, package.version)
|
||||||
|
package = JSON.parse(json_file)
|
||||||
|
Package::Migration.migrate(package['name'])
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def self._get_bin(name, version)
|
def self._get_bin(name, version)
|
||||||
package = Package.find_by(
|
package = Package.find_by(
|
||||||
name: name,
|
name: name,
|
||||||
|
|
Loading…
Reference in a new issue