-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added check for add_exclusion_constraint - closes #191
- Loading branch information
Showing
8 changed files
with
68 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require_relative "test_helper" | ||
|
||
class AddExclusionConstraintTest < Minitest::Test | ||
def setup | ||
skip unless ActiveRecord::VERSION::STRING.to_f >= 7.1 | ||
super | ||
end | ||
|
||
def test_basic | ||
assert_unsafe AddExclusionConstraint | ||
end | ||
|
||
def test_new_table | ||
assert_safe AddExclusionConstraintNewTable | ||
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,15 @@ | ||
class AddExclusionConstraint < TestMigration | ||
def change | ||
add_exclusion_constraint :users, "credit_score WITH =", using: :gist | ||
end | ||
end | ||
|
||
class AddExclusionConstraintNewTable < TestMigration | ||
def change | ||
create_table :new_users do |t| | ||
t.decimal :credit_score, precision: 10, scale: 5 | ||
end | ||
|
||
add_exclusion_constraint :new_users, "credit_score WITH =", using: :gist | ||
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