schema_plus_pg_indexes 0.1.4 → 0.1.5
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: f8c943acae7e058adf7569dbe70a4fef42c76c4a
|
4
|
+
data.tar.gz: 21b31c1c3e0488c6375989061814a2c4bdce65c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce0515363e77645cb4af33dd3cefdcdc76b692b8122254325b71a7e24ae136239fe0ca28a78b0d51bc65ba3c97425b1aae2cb6f3147ebac318228ed08b945a60
|
7
|
+
data.tar.gz: 363c8fedeb17bc367802965a08eaa6c389caac8a10d2f58458a0c8b3935ff2c4199aa8fc734f95d3c25456b8c972f5792b01b64667b47af627348dba04759df6
|
data/README.md
CHANGED
@@ -61,9 +61,9 @@ schema_plus_pg_indexes is tested on
|
|
61
61
|
|
62
62
|
## History
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
* Initial release
|
64
|
+
* v0.1.5 - Bug fix: t.index without column in change_table
|
65
|
+
* v0.1.1 through v0.1.4 - Conform to schema_dev updates
|
66
|
+
* v0.1.0 - Initial release
|
67
67
|
|
68
68
|
## Development & Testing
|
69
69
|
|
@@ -6,9 +6,8 @@ module SchemaPlusPgIndexes
|
|
6
6
|
# SchemaPlusPgIndexes allows the column_names paramter
|
7
7
|
# to be left off
|
8
8
|
#
|
9
|
-
def add_index(
|
10
|
-
options =
|
11
|
-
table_name, column_names = args
|
9
|
+
def add_index(table_name, column_names, options={})
|
10
|
+
column_names, options = [nil, column_names] if column_names.is_a? Hash
|
12
11
|
super table_name, column_names, options
|
13
12
|
end
|
14
13
|
end
|
data/spec/index_spec.rb
CHANGED
@@ -94,6 +94,22 @@ describe "index" do
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
expect(User.indexes.first.expression).to eq("upper((login)::text)")
|
97
|
+
expect(User.indexes.first.name).to eq("no_column")
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
context "change table" do
|
102
|
+
it "defines index with expression only" do
|
103
|
+
define_schema do
|
104
|
+
create_table :users, :force => true do |t|
|
105
|
+
t.string :login
|
106
|
+
end
|
107
|
+
change_table :users do |t|
|
108
|
+
t.index :expression => "upper(login)", name: "no_column"
|
109
|
+
end
|
110
|
+
end
|
111
|
+
expect(User.indexes.first.expression).to eq("upper((login)::text)")
|
112
|
+
expect(User.indexes.first.name).to eq("no_column")
|
97
113
|
end
|
98
114
|
end
|
99
115
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_plus_pg_indexes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ronen barzel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|