activerecord-jdbcvertica-adapter 0.1.0 → 0.1.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19cfc35f15a9f23356a1a6f1e8e2e3218a0b1d79
|
4
|
+
data.tar.gz: 6fe19177720c5a296a692ae5d72343b576c82868
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49d7dab9570e8494e759f65dc2b2b57e05eefebd298e4292ab29ce374f4e4039a0f3fb20d6b56b1811bf76d13e02e0b5382a65a50c9e176d90e9651498f23512
|
7
|
+
data.tar.gz: 72a2447a0ed4b14d9399ef76f86bf0edf79e45a3d1ed3d66eb6f705c750cb5ef6fe0e010f690d4c3ff560d4de727ffe0e0193ad5ae7cf49b583e80c85b298f5d
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'arjdbc/vertica/column'
|
2
|
+
require 'arjdbc/util/quoted_cache'
|
2
3
|
require 'securerandom'
|
3
4
|
|
4
5
|
# Load a mapping for the "text" type that will actually work
|
@@ -43,6 +44,8 @@ end
|
|
43
44
|
#
|
44
45
|
module ::ArJdbc
|
45
46
|
module Vertica
|
47
|
+
include ::ArJdbc::Util::QuotedCache
|
48
|
+
|
46
49
|
ADAPTER_NAME = 'Vertica'.freeze
|
47
50
|
INSERT_TABLE_EXTRACTION = /into\s+(?<table_name>[^\(]*).*values\s*\(/im
|
48
51
|
|
@@ -211,6 +214,10 @@ module ::ArJdbc
|
|
211
214
|
quote_column_name(attr)
|
212
215
|
end
|
213
216
|
|
217
|
+
def rename_column(table_name, column_name, new_column_name)
|
218
|
+
execute "ALTER TABLE #{quote_table_name(table_name)} RENAME COLUMN #{quote_column_name(column_name)} TO #{quote_column_name(new_column_name)}"
|
219
|
+
end
|
220
|
+
|
214
221
|
def remove_index(*args)
|
215
222
|
# no op
|
216
223
|
end
|
@@ -106,10 +106,12 @@ describe ColumnKing do
|
|
106
106
|
describe "#rename_column" do
|
107
107
|
it "does not rename columns (JDBC)" do
|
108
108
|
connection.add_column(:kings, :name, :string)
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
109
|
+
connection.rename_column(:kings, :name, :name2)
|
110
|
+
connection.column_exists?(:kings, :name2).must_equal(true)
|
111
|
+
connection.column_exists?(:kings, :name).must_equal(false)
|
112
|
+
connection.rename_column(:kings, :name2, :name)
|
113
|
+
connection.column_exists?(:kings, :name2).must_equal(false)
|
114
|
+
connection.column_exists?(:kings, :name).must_equal(true)
|
113
115
|
end
|
114
116
|
end
|
115
117
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-jdbcvertica-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Dewitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|