activerecord-jdbcas400-adapter 1.3.5.2 → 1.3.5.3

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
  SHA1:
3
- metadata.gz: 4fddcc7d8918b9ec607dec01d8eaff111d8274c0
4
- data.tar.gz: 65c6a256c837eacc790dccd6e7934dcbc69a1fe7
3
+ metadata.gz: a8f428070876558bc7762beff5cd5af5c9c1445d
4
+ data.tar.gz: ca0b644022949d4a5bad49ad89d5077a623b13a9
5
5
  SHA512:
6
- metadata.gz: 671d7603c462710fc088121e562b0f67bc7293452eabf4906e22dc469bda0e6c0be7b2c94fa576f33ba2e47fc203037ae360756c13818d0f98b5bc11d6443474
7
- data.tar.gz: aa006209bf9884f6118e91f7e9413648f04828facd5c5f86065e85a1de603bd59e3d8a29c228c6ef930f18fb58fed935f76e89dfe53b27d92b899b0951c511c1
6
+ metadata.gz: a539b53a3302c3fbed64b5609d589037f921c61b8fe9929f0e7f0805fb05c8ddde4369e94874b872348515ed8c84ff887ab59b40ad91a6689d28928b17017cb5
7
+ data.tar.gz: bbf0d9bee1d58120f3c10fb9a3004bbf4ed8b3dae7f4e0971b1c5556604cb4589427d5568e8485150780e4344f91c52135ab0df2af5e2e658d89702a3280911d
@@ -66,7 +66,10 @@ module ArJdbc
66
66
 
67
67
  # @override
68
68
  def rename_column(table_name, column_name, new_column_name)
69
- raise NotImplementedError, "rename_column is not supported on IBM iSeries"
69
+ column = columns(table_name, column_name).find { |column| column.name == column_name.to_s}
70
+ add_column(table_name, new_column_name, column.type)
71
+ execute("UPDATE #{table_name} SET #{new_column_name} = #{column_name}")
72
+ remove_column(table_name, column_name)
70
73
  end
71
74
 
72
75
  # @override
data/test/config.yml CHANGED
@@ -1,5 +1,5 @@
1
- host: 'inc400'
2
- username: 'pr'
3
- password: 'princ189'
1
+ host: ''
2
+ username: ''
3
+ password: ''
4
4
  schema: 'ARJDBC_TEST'
5
5
  libraries: 'QTEMP,ARJDBC_TEST'
data/test/test_adapter.rb CHANGED
@@ -16,4 +16,17 @@ class TestAdapter < Test::Unit::TestCase
16
16
  connection.execute('DROP TABLE test_table')
17
17
  end
18
18
  end
19
+
20
+ def test_rename_column
21
+ begin
22
+ connection.execute('CREATE TABLE test_table (test_column INTEGER)')
23
+ connection.execute('INSERT INTO test_table(test_column) VALUES(1)')
24
+
25
+ connection.rename_column('test_table', 'test_column', 'new_test_column')
26
+ assert_not_nil(connection.columns('test_table').find { |column| column.name == 'new_test_column' })
27
+ assert_equal(connection.select_one('SELECT new_test_column FROM test_table')['new_test_column'], 1)
28
+ ensure
29
+ connection.execute('DROP TABLE test_table')
30
+ end
31
+ end
19
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-jdbcas400-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5.2
4
+ version: 1.3.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sieger, Ola Bini, Pierrick Rouxel and JRuby contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-25 00:00:00.000000000 Z
11
+ date: 2014-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-jdbc-adapter