File tree Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -1267,6 +1267,9 @@ def test_update_coerced
1267
1267
assert_not_predicate topic , :approved?
1268
1268
assert_equal "The First Topic" , topic . title
1269
1269
end
1270
+
1271
+ # In SQL Server it's not possible to set the primary key column using a trigger and to get it then to return.
1272
+ coerce_tests! :test_model_with_no_auto_populated_fields_still_returns_primary_key_after_insert
1270
1273
end
1271
1274
1272
1275
require "models/author"
Original file line number Diff line number Diff line change 266
266
SELECT pk_col_one AS id_source, event_name FROM INSERTED
267
267
SQL
268
268
269
-
270
- execute <<-SQL
271
- CREATE TRIGGER instead_of_insert_trigger
272
- ON pk_autopopulated_by_a_trigger_records
273
- INSTEAD OF INSERT
274
- AS
275
- BEGIN
276
- INSERT INTO pk_autopopulated_by_a_trigger_records (
277
- [id]
278
- )
279
- SELECT ((COALESCE(MAX(pk_autopopulated_by_a_trigger_records.id), 0) + 1))
280
- FROM pk_autopopulated_by_a_trigger_records
281
- END
282
- SQL
283
-
284
269
# Another schema.
285
270
286
271
create_table :sst_schema_columns , force : true do |t |
You can’t perform that action at this time.
0 commit comments