-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
22 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
class RemoveDuplicateTokens < ActiveRecord::Migration[4.2] | ||
def up | ||
remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) | ||
remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, name: "tokens_host_id_fk") | ||
remove_index :tokens, :host_id if index_exists? :tokens, :host_id | ||
add_index :tokens, :host_id, :unique => true | ||
add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) | ||
add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, name: "tokens_host_id_fk") | ||
end | ||
|
||
def down | ||
remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) | ||
remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, name: "tokens_host_id_fk") | ||
remove_index :tokens, :host_id if index_exists? :tokens, :host_id | ||
add_index :tokens, :host_id | ||
add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) | ||
add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, name: "tokens_host_id_fk") | ||
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
class AddTypeToToken < ActiveRecord::Migration[5.1] | ||
def up | ||
remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) | ||
remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, name: "tokens_host_id_fk") | ||
remove_index :tokens, :host_id if index_exists? :tokens, :host_id # was unique | ||
add_index :tokens, :host_id | ||
add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) | ||
add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, name: "tokens_host_id_fk") | ||
add_column :tokens, :type, :string, default: 'Token::Build', null: false, index: true | ||
change_column :tokens, :value, :text | ||
end | ||
|
||
def down | ||
change_column :tokens, :value, :string, limit: 255 | ||
remove_column :tokens, :type | ||
remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) | ||
remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, name: "tokens_host_id_fk") | ||
remove_index :tokens, :host_id if index_exists? :tokens, :host_id | ||
add_index :tokens, :host_id, :unique => true | ||
add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) | ||
add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, name: "tokens_host_id_fk") | ||
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
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 |
---|---|---|
|
@@ -118,7 +118,7 @@ class SettingManagerTest < ActiveSupport::TestCase | |
default: '[email protected]', | ||
description: 'This is nicely described foo setting', | ||
full_name: 'Foo setting') | ||
validates(:validfoo, email: true) | ||
validates(:validfoo, { email: true }) | ||
end | ||
end | ||
Foreman::SettingManager.validations.setup! | ||
|
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