forked from theforeman/foreman
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added OS Family attribute to Partition Tables and Installation Medium
- Loading branch information
Showing
10 changed files
with
54 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class AddOsFamilyToMedia < ActiveRecord::Migration | ||
def self.up | ||
add_column :media, :os_family, :string | ||
Medium.reset_column_information | ||
Medium.all.each do |m| | ||
family = m.operatingsystems.map(&:family).uniq.first rescue nil | ||
m.update_attribute(:os_family, family) if family | ||
end | ||
end | ||
|
||
def self.down | ||
remove_column :media, :os_family | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class AddOsFamilyToPtable < ActiveRecord::Migration | ||
def self.up | ||
add_column :ptables, :os_family, :string | ||
remove_column :ptables, :operatingsystem_id | ||
Ptable.reset_column_information | ||
Ptable.all.each do |p| | ||
family = p.operatingsystems.map(&:family).uniq.first rescue nil | ||
p.update_attribute(:os_family, family) if family | ||
end | ||
|
||
end | ||
|
||
def self.down | ||
remove_column :ptables, :os_family | ||
add_column :ptables, :operatingsystem_id, :integer | ||
end | ||
end |