pg_comment 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.travis.yml +7 -0
- data/Gemfile +2 -0
- data/README.markdown +4 -1
- data/Rakefile +1 -0
- data/lib/pg_comment/connection_adapters/postgresql_adapter.rb +1 -0
- data/lib/pg_comment/schema_dumper.rb +6 -6
- data/lib/pg_comment/version.rb +1 -1
- data/spec/dummy/db/schema.rb +0 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGMxNWZlYjYzM2FhOTkyYjQyYmVjMjk4NDM3NTQyY2EyMWJmODFmZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzY1MDg5OGMxOTVhOTBkMDk4MzZkZmVjNjlkYTk5ZDQ4NzdiNmI3ZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmEyYWMwZWViNmI5ZTYxYzk1MDY2ZTRmMzFlYzk4YmY0ZDM1ODNkMjljMjg0
|
10
|
+
ZjNjZjdiZTcxMmQ3NjU0MWFiOWQ0YzM4MWU3YjljMjEzMTRmYjYyYWU3YWVj
|
11
|
+
ZmFjY2FlNjAzYzFhZDY1MmRjZGM0NmZiMTQ3ZTBmOTZhNjc1MTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDkwYzc3NGU1YzEwNTNhNDA4NDZhYjRkZjY0ZmRjNTY3MGViYjNjNjE1MTAw
|
14
|
+
MTVkYzI0YWExYjJjNjE4Mjc2NzJhYjAxZmM3NTY1N2FkNGVkYzI0N2Q3ODk3
|
15
|
+
Yzc3Y2ZlMTdmMTc5MjViZTBlMzM2ZmJiNDJkZTYwYzNhYjA3Zjk=
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.markdown
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
https://github.com/albertosaurus/pg_comment
|
4
4
|
|
5
|
+
[](https://travis-ci.org/albertosaurus/pg_comment)
|
6
|
+
[](https://codeclimate.com/github/albertosaurus/pg_comment)
|
7
|
+
|
5
8
|
In any PostgreSQL database where the Rails app is not the only consumer, it is very helpful to have comments
|
6
9
|
on the various elements of the schema. PgComment extends the migrations DSL with methods to set and remove
|
7
10
|
comments on columns, tables and indexes. It also dumps those comments into your schema.rb.
|
@@ -100,4 +103,4 @@ end
|
|
100
103
|
|
101
104
|
Copyright (c) 2011-2013 Arthur Shagall, Mindflight, Inc.
|
102
105
|
|
103
|
-
Released under the MIT License. See LICENSE for details.
|
106
|
+
Released under the MIT License. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -11,6 +11,12 @@ module PgComment
|
|
11
11
|
@connection.tables.sort.each do |table_name|
|
12
12
|
dump_comments(table_name, stream)
|
13
13
|
end
|
14
|
+
|
15
|
+
unless (index_comments = @connection.index_comments).empty?
|
16
|
+
index_comments.each_pair do |index_name, comment|
|
17
|
+
stream.puts " set_index_comment '#{index_name}', '#{comment.gsub(/'/, "\\\\'")}'"
|
18
|
+
end
|
19
|
+
end
|
14
20
|
end
|
15
21
|
|
16
22
|
def dump_comments(table_name, stream)
|
@@ -29,12 +35,6 @@ module PgComment
|
|
29
35
|
stream.puts comment_statements.join("\n")
|
30
36
|
stream.puts
|
31
37
|
end
|
32
|
-
|
33
|
-
unless (index_comments = @connection.index_comments).empty?
|
34
|
-
index_comments.each_pair do |index_name, comment|
|
35
|
-
stream.puts " set_index_comment '#{index_name}', '#{comment.gsub(/'/, "\\\\'")}'"
|
36
|
-
end
|
37
|
-
end
|
38
38
|
end
|
39
39
|
private :dump_comments
|
40
40
|
end
|
data/lib/pg_comment/version.rb
CHANGED
data/spec/dummy/db/schema.rb
CHANGED
@@ -21,7 +21,6 @@ ActiveRecord::Schema.define(:version => 20130502030557) do
|
|
21
21
|
|
22
22
|
add_index "vegetables", ["name"], :name => "index_vegetables_on_name", :unique => true
|
23
23
|
|
24
|
-
set_index_comment 'index_vegetables_on_name', 'Comment on index'
|
25
24
|
set_table_comment 'vegetables', 'Healthy and delicious'
|
26
25
|
set_column_comment 'vegetables', 'name', 'The name of the vegetable'
|
27
26
|
set_column_comment 'vegetables', 'price', 'vegetable cost'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_comment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arthur Shagall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -76,6 +76,7 @@ extra_rdoc_files: []
|
|
76
76
|
files:
|
77
77
|
- .gitignore
|
78
78
|
- .rspec
|
79
|
+
- .travis.yml
|
79
80
|
- Gemfile
|
80
81
|
- LICENSE
|
81
82
|
- README.markdown
|