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 +4 -4
- data/lib/arjdbc/as400/adapter.rb +4 -1
- data/test/config.yml +3 -3
- data/test/test_adapter.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8f428070876558bc7762beff5cd5af5c9c1445d
|
4
|
+
data.tar.gz: ca0b644022949d4a5bad49ad89d5077a623b13a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a539b53a3302c3fbed64b5609d589037f921c61b8fe9929f0e7f0805fb05c8ddde4369e94874b872348515ed8c84ff887ab59b40ad91a6689d28928b17017cb5
|
7
|
+
data.tar.gz: bbf0d9bee1d58120f3c10fb9a3004bbf4ed8b3dae7f4e0971b1c5556604cb4589427d5568e8485150780e4344f91c52135ab0df2af5e2e658d89702a3280911d
|
data/lib/arjdbc/as400/adapter.rb
CHANGED
@@ -66,7 +66,10 @@ module ArJdbc
|
|
66
66
|
|
67
67
|
# @override
|
68
68
|
def rename_column(table_name, column_name, new_column_name)
|
69
|
-
|
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
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.
|
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-
|
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
|