activerecord-sqlserver-adapter 7.2.0 → 7.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6356803690516019929168fed2c356f3250eb5ec8a9894b8117fc35db84b8c1
4
- data.tar.gz: dbedbedb583e766c526d959459166edd195516700fb6f0b1be2769ea1d947233
3
+ metadata.gz: 73bbb76f7c1a620edbaf0aa6e69c5a8fcb9ba2f7c7c14716bb2663f776b8cb0d
4
+ data.tar.gz: a6d9ac56dbcddd486bd0111da5db2e2d0cc6c2bbc3519041a73fffa5cfc3fddb
5
5
  SHA512:
6
- metadata.gz: 5079fd8e88a8e67b91f11de2f9ec158d686afe121461f2b2050ebdd1072f1ac0fc86356dd81da507e99b72b8f9266aa5a59031d886dcb8d119715cab4cbef1c8
7
- data.tar.gz: d1a8f37563ba09c443242e83f75098b2cc74bd269c9b11b9c6834a5e2fa23c7791f93083c7884ec1d22acdeca3bdf75f752153bde565fa0d92c3988a6653565c
6
+ metadata.gz: 921bd35d9de85b363190dee9b001373fbae60b0c1e99755ff4b172c9f51510d7353b49fb39d636b4acc015755067846bfed6ca4f984eb75d91def007679154da
7
+ data.tar.gz: 384e76d966178e7c8bdc4f84cc03e3739bcfec1291fd42e57d8eb4804b7df37e4311f94ee659efa4d6b76a82ae833f8cd741f66bb667abf7a1e0c2f182107be9
@@ -1,17 +1,11 @@
1
1
  name: CI
2
2
 
3
- on:
4
- push:
5
- branches: [ main ]
6
- pull_request:
7
- branches: [ main ]
8
- schedule:
9
- - cron: '0 18 * * *'
3
+ on: [push, pull_request]
10
4
 
11
5
  jobs:
12
6
  test:
13
7
  name: Run test suite
14
- runs-on: ubuntu-latest
8
+ runs-on: ubuntu-20.04 # TODO: Change back to 'ubuntu-latest' when https://github.com/microsoft/mssql-docker/issues/899 resolved.
15
9
 
16
10
  env:
17
11
  COMPOSE_FILE: docker-compose.ci.yml
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
- ## Unreleased
1
+ ## v7.2.1
2
+
3
+ #### Fixed
4
+
5
+ - [#1231](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1231) Enable identity insert on view's base table
6
+
7
+ ## v7.2.0
2
8
 
3
9
  #### Added
4
10
 
@@ -9,4 +15,5 @@
9
15
  - [#1153](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1153) Only support Ruby v3.1+
10
16
  - [#1196](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1196) Use default inspect for database adapter
11
17
 
18
+
12
19
  Please check [7-1-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/7-1-stable/CHANGELOG.md) for previous changes.
data/Dockerfile.ci CHANGED
@@ -9,6 +9,6 @@ WORKDIR $WORKDIR
9
9
 
10
10
  COPY . $WORKDIR
11
11
 
12
- RUN bundle install --jobs `expr $(cat /proc/cpuinfo | grep -c "cpu cores") - 1` --retry 3
12
+ RUN RAILS_BRANCH=7-2-stable bundle install --jobs `expr $(cat /proc/cpuinfo | grep -c "cpu cores") - 1` --retry 3
13
13
 
14
14
  CMD ["sh"]
data/README.md CHANGED
@@ -18,8 +18,8 @@ their stable branches.
18
18
  |-----------------|---------------|----------------|-------------------------------------------------------------------------------------------------|
19
19
  | `7.2.x` | `7.2.x` | Active | [main](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/main) |
20
20
  | `7.1.x` | `7.1.x` | Active | [7-1-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/7-1-stable) |
21
- | `7.0.x` | `7.0.x` | Active | [7-0-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/7-0-stable) |
22
- | `6.1.x` | `6.1.x` | Active | [6-1-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/6-1-stable) |
21
+ | `7.0.x` | `7.0.x` | Ended | [7-0-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/7-0-stable) |
22
+ | `6.1.x` | `6.1.x` | Ended | [6-1-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/6-1-stable) |
23
23
  | `6.0.x` | `6.0.x` | Ended | [6-0-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/6-0-stable) |
24
24
  | `5.2.x` | `5.2.x` | Ended | [5-2-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/5-2-stable) |
25
25
  | `5.1.x` | `5.1.x` | Ended | [5-1-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/5-1-stable) |
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.2.0
1
+ 7.2.1
@@ -5,6 +5,7 @@ services:
5
5
  ci:
6
6
  environment:
7
7
  - ACTIVERECORD_UNITTEST_HOST=sqlserver
8
+ - RAILS_BRANCH=7-2-stable
8
9
  build:
9
10
  context: .
10
11
  dockerfile: Dockerfile.ci
@@ -42,6 +42,9 @@ module ActiveRecord
42
42
  log(sql, name, binds, async: async) do |notification_payload|
43
43
  with_raw_connection do |conn|
44
44
  result = if id_insert_table_name = query_requires_identity_insert?(sql)
45
+ # If the table name is a view, we need to get the base table name for enabling identity insert.
46
+ id_insert_table_name = view_table_name(id_insert_table_name) if view_exists?(id_insert_table_name)
47
+
45
48
  with_identity_insert_enabled(id_insert_table_name, conn) do
46
49
  internal_exec_sql_query(sql, conn)
47
50
  end
@@ -47,4 +47,12 @@ class ViewTestSQLServer < ActiveRecord::TestCase
47
47
  assert_equal 1, klass.count
48
48
  end
49
49
  end
50
+
51
+ describe 'identity insert' do
52
+ it "identity insert works with views" do
53
+ assert_difference("SSTestCustomersView.count", 1) do
54
+ SSTestCustomersView.create!(id: 5, name: "Bob")
55
+ end
56
+ end
57
+ end
50
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-sqlserver-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.0
4
+ version: 7.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2024-08-12 00:00:00.000000000 Z
18
+ date: 2024-10-02 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activerecord
@@ -239,8 +239,8 @@ licenses:
239
239
  - MIT
240
240
  metadata:
241
241
  bug_tracker_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues
242
- changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v7.2.0/CHANGELOG.md
243
- source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v7.2.0
242
+ changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v7.2.1/CHANGELOG.md
243
+ source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v7.2.1
244
244
  post_install_message:
245
245
  rdoc_options: []
246
246
  require_paths: