Skip to content

Commit

Permalink
Coerce test
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanharan committed Jun 8, 2024
1 parent 68953a4 commit a228501
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
3 changes: 3 additions & 0 deletions test/cases/coerced_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,9 @@ def test_update_coerced
assert_not_predicate topic, :approved?
assert_equal "The First Topic", topic.title
end

# In SQL Server it's not possible to set the primary key column using a trigger and to get it then to return.
coerce_tests! :test_model_with_no_auto_populated_fields_still_returns_primary_key_after_insert
end

require "models/author"
Expand Down
15 changes: 0 additions & 15 deletions test/schema/sqlserver_specific_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,21 +266,6 @@
SELECT pk_col_one AS id_source, event_name FROM INSERTED
SQL


execute <<-SQL
CREATE TRIGGER instead_of_insert_trigger
ON pk_autopopulated_by_a_trigger_records
INSTEAD OF INSERT
AS
BEGIN
INSERT INTO pk_autopopulated_by_a_trigger_records (
[id]
)
SELECT ((COALESCE(MAX(pk_autopopulated_by_a_trigger_records.id), 0) + 1))
FROM pk_autopopulated_by_a_trigger_records
END
SQL

# Another schema.

create_table :sst_schema_columns, force: true do |t|
Expand Down

0 comments on commit a228501

Please sign in to comment.