schema_plus_views 0.4.1 → 1.0.0
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 +4 -4
- data/.github/workflows/prs.yml +194 -0
- data/.gitignore +1 -0
- data/.simplecov +20 -0
- data/Gemfile +4 -1
- data/README.md +18 -16
- data/Rakefile +2 -0
- data/gemfiles/activerecord-6.0/Gemfile.base +4 -0
- data/gemfiles/activerecord-6.0/Gemfile.mysql2 +10 -0
- data/gemfiles/activerecord-6.0/Gemfile.postgresql +10 -0
- data/gemfiles/activerecord-6.0/Gemfile.sqlite3 +10 -0
- data/lib/schema_plus/views/active_record/connection_adapters/abstract_adapter.rb +2 -0
- data/lib/schema_plus/views/active_record/connection_adapters/mysql2_adapter.rb +2 -0
- data/lib/schema_plus/views/active_record/connection_adapters/postgresql_adapter.rb +2 -0
- data/lib/schema_plus/views/active_record/connection_adapters/sqlite3_adapter.rb +2 -0
- data/lib/schema_plus/views/active_record/migration/command_recorder.rb +2 -0
- data/lib/schema_plus/views/middleware.rb +3 -21
- data/lib/schema_plus/views/schema_dump.rb +28 -0
- data/lib/schema_plus/views/version.rb +3 -1
- data/lib/schema_plus/views.rb +3 -0
- data/lib/schema_plus_views.rb +2 -0
- data/schema_dev.yml +4 -2
- data/schema_plus_views.gemspec +9 -8
- data/spec/dumper_spec.rb +2 -0
- data/spec/introspection_spec.rb +2 -0
- data/spec/middleware_spec.rb +2 -0
- data/spec/migration_spec.rb +2 -0
- data/spec/named_schemas_spec.rb +2 -0
- data/spec/sanity_spec.rb +2 -0
- data/spec/spec_helper.rb +3 -2
- metadata +26 -42
- data/.travis.yml +0 -89
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6dc17514d0000f4bdfee9c6840afec09ce47fa0635d89cefbc82667f197b904
|
|
4
|
+
data.tar.gz: b12b99196f5d28b120e97aae3bd7bfc698a7e004439b6e0538ffbc2c079ecd13
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 03666f035ea72b9f03a6ff2d20321adb8a1adb7e0c13682229e3f9f52e7c94876408e9597eb4c42c8b6eac5ae6c046c826d3cc7daa8ed2ab4b4afbf00326ba82
|
|
7
|
+
data.tar.gz: 192ccf942b56d1d09409895d7b9c9eb9693ec30fa497ddad80ec5114c0090f4d13a6db37ea070b3df124bd1e65af5d8069a2fcf76b56206aa0436745568a8d4f
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# This file was auto-generated by the schema_dev tool, based on the data in
|
|
2
|
+
# ./schema_dev.yml
|
|
3
|
+
# Please do not edit this file; any changes will be overwritten next time
|
|
4
|
+
# schema_dev gets run.
|
|
5
|
+
---
|
|
6
|
+
name: CI PR Builds
|
|
7
|
+
'on':
|
|
8
|
+
push:
|
|
9
|
+
branches:
|
|
10
|
+
- master
|
|
11
|
+
pull_request:
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ci-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
jobs:
|
|
16
|
+
test:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
strategy:
|
|
19
|
+
fail-fast: false
|
|
20
|
+
matrix:
|
|
21
|
+
ruby:
|
|
22
|
+
- '2.5'
|
|
23
|
+
- '2.7'
|
|
24
|
+
- '3.0'
|
|
25
|
+
activerecord:
|
|
26
|
+
- '5.2'
|
|
27
|
+
- '6.0'
|
|
28
|
+
db:
|
|
29
|
+
- mysql2
|
|
30
|
+
- sqlite3
|
|
31
|
+
- skip
|
|
32
|
+
dbversion:
|
|
33
|
+
- skip
|
|
34
|
+
exclude:
|
|
35
|
+
- ruby: '3.0'
|
|
36
|
+
activerecord: '5.2'
|
|
37
|
+
- db: skip
|
|
38
|
+
dbversion: skip
|
|
39
|
+
include:
|
|
40
|
+
- ruby: '2.5'
|
|
41
|
+
activerecord: '5.2'
|
|
42
|
+
db: postgresql
|
|
43
|
+
dbversion: '9.6'
|
|
44
|
+
- ruby: '2.5'
|
|
45
|
+
activerecord: '5.2'
|
|
46
|
+
db: postgresql
|
|
47
|
+
dbversion: '10'
|
|
48
|
+
- ruby: '2.5'
|
|
49
|
+
activerecord: '5.2'
|
|
50
|
+
db: postgresql
|
|
51
|
+
dbversion: '11'
|
|
52
|
+
- ruby: '2.5'
|
|
53
|
+
activerecord: '5.2'
|
|
54
|
+
db: postgresql
|
|
55
|
+
dbversion: '12'
|
|
56
|
+
- ruby: '2.5'
|
|
57
|
+
activerecord: '6.0'
|
|
58
|
+
db: postgresql
|
|
59
|
+
dbversion: '9.6'
|
|
60
|
+
- ruby: '2.5'
|
|
61
|
+
activerecord: '6.0'
|
|
62
|
+
db: postgresql
|
|
63
|
+
dbversion: '10'
|
|
64
|
+
- ruby: '2.5'
|
|
65
|
+
activerecord: '6.0'
|
|
66
|
+
db: postgresql
|
|
67
|
+
dbversion: '11'
|
|
68
|
+
- ruby: '2.5'
|
|
69
|
+
activerecord: '6.0'
|
|
70
|
+
db: postgresql
|
|
71
|
+
dbversion: '12'
|
|
72
|
+
- ruby: '2.7'
|
|
73
|
+
activerecord: '5.2'
|
|
74
|
+
db: postgresql
|
|
75
|
+
dbversion: '9.6'
|
|
76
|
+
- ruby: '2.7'
|
|
77
|
+
activerecord: '5.2'
|
|
78
|
+
db: postgresql
|
|
79
|
+
dbversion: '10'
|
|
80
|
+
- ruby: '2.7'
|
|
81
|
+
activerecord: '5.2'
|
|
82
|
+
db: postgresql
|
|
83
|
+
dbversion: '11'
|
|
84
|
+
- ruby: '2.7'
|
|
85
|
+
activerecord: '5.2'
|
|
86
|
+
db: postgresql
|
|
87
|
+
dbversion: '12'
|
|
88
|
+
- ruby: '2.7'
|
|
89
|
+
activerecord: '6.0'
|
|
90
|
+
db: postgresql
|
|
91
|
+
dbversion: '9.6'
|
|
92
|
+
- ruby: '2.7'
|
|
93
|
+
activerecord: '6.0'
|
|
94
|
+
db: postgresql
|
|
95
|
+
dbversion: '10'
|
|
96
|
+
- ruby: '2.7'
|
|
97
|
+
activerecord: '6.0'
|
|
98
|
+
db: postgresql
|
|
99
|
+
dbversion: '11'
|
|
100
|
+
- ruby: '2.7'
|
|
101
|
+
activerecord: '6.0'
|
|
102
|
+
db: postgresql
|
|
103
|
+
dbversion: '12'
|
|
104
|
+
- ruby: '3.0'
|
|
105
|
+
activerecord: '6.0'
|
|
106
|
+
db: postgresql
|
|
107
|
+
dbversion: '9.6'
|
|
108
|
+
- ruby: '3.0'
|
|
109
|
+
activerecord: '6.0'
|
|
110
|
+
db: postgresql
|
|
111
|
+
dbversion: '10'
|
|
112
|
+
- ruby: '3.0'
|
|
113
|
+
activerecord: '6.0'
|
|
114
|
+
db: postgresql
|
|
115
|
+
dbversion: '11'
|
|
116
|
+
- ruby: '3.0'
|
|
117
|
+
activerecord: '6.0'
|
|
118
|
+
db: postgresql
|
|
119
|
+
dbversion: '12'
|
|
120
|
+
env:
|
|
121
|
+
BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}/Gemfile.${{ matrix.db }}"
|
|
122
|
+
MYSQL_DB_HOST: 127.0.0.1
|
|
123
|
+
MYSQL_DB_USER: root
|
|
124
|
+
MYSQL_DB_PASS: database
|
|
125
|
+
POSTGRESQL_DB_HOST: 127.0.0.1
|
|
126
|
+
POSTGRESQL_DB_USER: schema_plus_test
|
|
127
|
+
POSTGRESQL_DB_PASS: database
|
|
128
|
+
steps:
|
|
129
|
+
- uses: actions/checkout@v2
|
|
130
|
+
- name: Set up Ruby
|
|
131
|
+
uses: ruby/setup-ruby@v1
|
|
132
|
+
with:
|
|
133
|
+
ruby-version: "${{ matrix.ruby }}"
|
|
134
|
+
bundler-cache: true
|
|
135
|
+
- name: Run bundle update
|
|
136
|
+
run: bundle update
|
|
137
|
+
- name: Start Mysql
|
|
138
|
+
if: matrix.db == 'mysql2'
|
|
139
|
+
run: |
|
|
140
|
+
docker run --rm --detach \
|
|
141
|
+
-e MYSQL_ROOT_PASSWORD=$MYSQL_DB_PASS \
|
|
142
|
+
-p 3306:3306 \
|
|
143
|
+
--health-cmd "mysqladmin ping --host=127.0.0.1 --password=$MYSQL_DB_PASS --silent" \
|
|
144
|
+
--health-interval 5s \
|
|
145
|
+
--health-timeout 5s \
|
|
146
|
+
--health-retries 5 \
|
|
147
|
+
--name database mysql:5.6
|
|
148
|
+
- name: Start Postgresql
|
|
149
|
+
if: matrix.db == 'postgresql'
|
|
150
|
+
run: |
|
|
151
|
+
docker run --rm --detach \
|
|
152
|
+
-e POSTGRES_USER=$POSTGRESQL_DB_USER \
|
|
153
|
+
-e POSTGRES_PASSWORD=$POSTGRESQL_DB_PASS \
|
|
154
|
+
-p 5432:5432 \
|
|
155
|
+
--health-cmd "pg_isready -q" \
|
|
156
|
+
--health-interval 5s \
|
|
157
|
+
--health-timeout 5s \
|
|
158
|
+
--health-retries 5 \
|
|
159
|
+
--name database postgres:${{ matrix.dbversion }}
|
|
160
|
+
- name: Wait for database to start
|
|
161
|
+
if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
|
|
162
|
+
run: |
|
|
163
|
+
COUNT=0
|
|
164
|
+
ATTEMPTS=20
|
|
165
|
+
until [[ $COUNT -eq $ATTEMPTS ]]; do
|
|
166
|
+
[ "$(docker inspect -f {{.State.Health.Status}} database)" == "healthy" ] && break
|
|
167
|
+
echo $(( COUNT++ )) > /dev/null
|
|
168
|
+
sleep 2
|
|
169
|
+
done
|
|
170
|
+
- name: Create testing database
|
|
171
|
+
if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
|
|
172
|
+
run: bundle exec rake create_ci_database
|
|
173
|
+
- name: Run tests
|
|
174
|
+
run: bundle exec rake spec
|
|
175
|
+
- name: Shutdown database
|
|
176
|
+
if: always() && (matrix.db == 'postgresql' || matrix.db == 'mysql2')
|
|
177
|
+
run: docker stop database
|
|
178
|
+
- name: Coveralls Parallel
|
|
179
|
+
if: "${{ !env.ACT }}"
|
|
180
|
+
uses: coverallsapp/github-action@master
|
|
181
|
+
with:
|
|
182
|
+
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
183
|
+
flag-name: run-${{ matrix.ruby }}-${{ matrix.activerecord }}-${{ matrix.db }}-${{ matrix.dbversion }}
|
|
184
|
+
parallel: true
|
|
185
|
+
finish:
|
|
186
|
+
needs: test
|
|
187
|
+
runs-on: ubuntu-latest
|
|
188
|
+
steps:
|
|
189
|
+
- name: Coveralls Finished
|
|
190
|
+
if: "${{ !env.ACT }}"
|
|
191
|
+
uses: coverallsapp/github-action@master
|
|
192
|
+
with:
|
|
193
|
+
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
194
|
+
parallel-finished: true
|
data/.gitignore
CHANGED
data/.simplecov
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
SimpleCov.configure do
|
|
4
|
+
enable_coverage :branch
|
|
5
|
+
add_filter '/spec/'
|
|
6
|
+
|
|
7
|
+
add_group 'Binaries', '/bin/'
|
|
8
|
+
add_group 'Libraries', '/lib/'
|
|
9
|
+
|
|
10
|
+
if ENV['CI']
|
|
11
|
+
require 'simplecov-lcov'
|
|
12
|
+
|
|
13
|
+
SimpleCov::Formatter::LcovFormatter.config do |c|
|
|
14
|
+
c.report_with_single_file = true
|
|
15
|
+
c.single_report_path = 'coverage/lcov.info'
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
formatter SimpleCov::Formatter::LcovFormatter
|
|
19
|
+
end
|
|
20
|
+
end
|
data/Gemfile
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
source "http://rubygems.org"
|
|
2
4
|
|
|
3
5
|
gemspec
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
gemfile_local = File.expand_path '../Gemfile.local', __FILE__
|
|
8
|
+
eval File.read(gemfile_local), binding, gemfile_local if File.exist? gemfile_local
|
data/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
[](http://badge.fury.io/rb/schema_plus_views)
|
|
2
|
-
[](https://gemnasium.com/SchemaPlus/schema_plus_views)
|
|
2
|
+
[](http://github.com/SchemaPlus/schema_plus_views/actions)
|
|
3
|
+
[](https://coveralls.io/github/SchemaPlus/schema_plus_views)
|
|
5
4
|
|
|
6
5
|
# SchemaPlus::Views
|
|
7
6
|
|
|
@@ -28,8 +27,11 @@ SchemaPlus::Views is tested on:
|
|
|
28
27
|
|
|
29
28
|
<!-- SCHEMA_DEV: MATRIX - begin -->
|
|
30
29
|
<!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
|
|
31
|
-
* ruby **2.5
|
|
32
|
-
* ruby **2.
|
|
30
|
+
* ruby **2.5** with activerecord **5.2**, using **mysql2**, **sqlite3**, **postgresql:9.6**, **postgresql:10**, **postgresql:11** or **postgresql:12**
|
|
31
|
+
* ruby **2.5** with activerecord **6.0**, using **mysql2**, **sqlite3**, **postgresql:9.6**, **postgresql:10**, **postgresql:11** or **postgresql:12**
|
|
32
|
+
* ruby **2.7** with activerecord **5.2**, using **mysql2**, **sqlite3**, **postgresql:9.6**, **postgresql:10**, **postgresql:11** or **postgresql:12**
|
|
33
|
+
* ruby **2.7** with activerecord **6.0**, using **mysql2**, **sqlite3**, **postgresql:9.6**, **postgresql:10**, **postgresql:11** or **postgresql:12**
|
|
34
|
+
* ruby **3.0** with activerecord **6.0**, using **mysql2**, **sqlite3**, **postgresql:9.6**, **postgresql:10**, **postgresql:11** or **postgresql:12**
|
|
33
35
|
|
|
34
36
|
<!-- SCHEMA_DEV: MATRIX - end -->
|
|
35
37
|
|
|
@@ -189,17 +191,18 @@ options in `env.options`
|
|
|
189
191
|
|
|
190
192
|
## History
|
|
191
193
|
|
|
192
|
-
* 0.
|
|
193
|
-
* 0.4.
|
|
194
|
-
* 0.
|
|
195
|
-
* 0.3.
|
|
194
|
+
* **1.0.0** - Add ruby 3 and AR 6.0, drop Ruy < 2.5
|
|
195
|
+
* **0.4.1** - Corrected spacing around dumped schema
|
|
196
|
+
* **0.4.0** - Added support for Rails 5.2 and materialized views in PostgreSQL
|
|
197
|
+
* **0.3.1** - Upgrade schema_plus_core and schema_dev dependencies
|
|
198
|
+
* **0.3.0**
|
|
196
199
|
- Added middleware stacks
|
|
197
200
|
- Bug fix: view_definition: strip white space from result (postgresql)
|
|
198
|
-
* 0.2.3 - Remove unnecessary escaping in dump; use single-quote heredoc
|
|
199
|
-
* 0.2.2 - Prettier dumps: use heredoc for definition string
|
|
200
|
-
* 0.2.1 - Fix db:rollback
|
|
201
|
-
* 0.2.0 - Added :allow_replace option (thanks to [@hcarver](https://github.com/hcarver))
|
|
202
|
-
* 0.1.0 - Initial release, extracted from schema_plus 1.x
|
|
201
|
+
* **0.2.3** - Remove unnecessary escaping in dump; use single-quote heredoc
|
|
202
|
+
* **0.2.2** - Prettier dumps: use heredoc for definition string
|
|
203
|
+
* **0.2.1** - Fix db:rollback
|
|
204
|
+
* **0.2.0** - Added :allow_replace option (thanks to [@hcarver](https://github.com/hcarver))
|
|
205
|
+
* **0.1.0** - Initial release, extracted from schema_plus 1.x
|
|
203
206
|
|
|
204
207
|
## Development & Testing
|
|
205
208
|
|
|
@@ -212,7 +215,7 @@ Some things to know about to help you develop and test:
|
|
|
212
215
|
* **schema_dev**: SchemaPlus::Views uses [schema_dev](https://github.com/SchemaPlus/schema_dev) to
|
|
213
216
|
facilitate running rspec tests on the matrix of ruby, activerecord, and database
|
|
214
217
|
versions that the gem supports, both locally and on
|
|
215
|
-
[
|
|
218
|
+
[github actions](https://github.com/SchemaPlus/schema_plus_views/actions)
|
|
216
219
|
|
|
217
220
|
To to run rspec locally on the full matrix, do:
|
|
218
221
|
|
|
@@ -224,7 +227,6 @@ Some things to know about to help you develop and test:
|
|
|
224
227
|
The matrix of configurations is specified in `schema_dev.yml` in
|
|
225
228
|
the project root.
|
|
226
229
|
|
|
227
|
-
|
|
228
230
|
<!-- SCHEMA_DEV: TEMPLATE USES SCHEMA_DEV - end -->
|
|
229
231
|
|
|
230
232
|
<!-- SCHEMA_DEV: TEMPLATE USES SCHEMA_PLUS_CORE - begin -->
|
data/Rakefile
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module SchemaPlus::Views
|
|
2
4
|
module Middleware
|
|
3
5
|
|
|
@@ -21,7 +23,7 @@ module SchemaPlus::Views
|
|
|
21
23
|
end
|
|
22
24
|
end
|
|
23
25
|
|
|
24
|
-
view = View.new(
|
|
26
|
+
view = ::SchemaPlus::Views::SchemaDump::View.new(
|
|
25
27
|
name: view_name,
|
|
26
28
|
definition: definition,
|
|
27
29
|
view_type: view_type,
|
|
@@ -47,26 +49,6 @@ module SchemaPlus::Views
|
|
|
47
49
|
|
|
48
50
|
options
|
|
49
51
|
end
|
|
50
|
-
|
|
51
|
-
# quacks like a SchemaMonkey Dump::Table
|
|
52
|
-
class View < KeyStruct[:name, :definition, :view_type, :indexes]
|
|
53
|
-
def assemble(stream)
|
|
54
|
-
extra_options = ", materialized: true" if view_type == :materialized
|
|
55
|
-
heredelim = "END_VIEW_#{name.upcase}"
|
|
56
|
-
stream.puts <<~ENDVIEW
|
|
57
|
-
create_view "#{name}", <<-'#{heredelim}', :force => true#{extra_options}
|
|
58
|
-
#{definition}
|
|
59
|
-
#{heredelim}
|
|
60
|
-
ENDVIEW
|
|
61
|
-
|
|
62
|
-
indexes.each do |index|
|
|
63
|
-
stream.write "add_index \"#{name}\", "
|
|
64
|
-
index.assemble(stream)
|
|
65
|
-
stream.puts ""
|
|
66
|
-
end
|
|
67
|
-
stream.puts ""
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
52
|
end
|
|
71
53
|
end
|
|
72
54
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SchemaPlus
|
|
4
|
+
module Views
|
|
5
|
+
class SchemaDump
|
|
6
|
+
# quacks like a SchemaMonkey Dump::Table
|
|
7
|
+
class View < Struct.new(:name, :definition, :view_type, :indexes, keyword_init: true)
|
|
8
|
+
def assemble(stream)
|
|
9
|
+
extra_options = ", materialized: true" if view_type == :materialized
|
|
10
|
+
heredelim = "END_VIEW_#{name.upcase}"
|
|
11
|
+
stream.puts <<~ENDVIEW
|
|
12
|
+
create_view "#{name}", <<-'#{heredelim}', :force => true#{extra_options}
|
|
13
|
+
#{definition}
|
|
14
|
+
#{heredelim}
|
|
15
|
+
ENDVIEW
|
|
16
|
+
stream.puts
|
|
17
|
+
|
|
18
|
+
indexes.each do |index|
|
|
19
|
+
stream.write " add_index \"#{name}\", "
|
|
20
|
+
index.assemble(stream)
|
|
21
|
+
stream.puts ""
|
|
22
|
+
end
|
|
23
|
+
stream.puts ""
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
data/lib/schema_plus/views.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'schema_plus/core'
|
|
2
4
|
|
|
3
5
|
module SchemaPlus
|
|
@@ -9,6 +11,7 @@ require_relative 'views/version'
|
|
|
9
11
|
require_relative 'views/active_record/connection_adapters/abstract_adapter'
|
|
10
12
|
require_relative 'views/active_record/migration/command_recorder'
|
|
11
13
|
require_relative 'views/middleware'
|
|
14
|
+
require_relative 'views/schema_dump'
|
|
12
15
|
|
|
13
16
|
module SchemaPlus::Views
|
|
14
17
|
module ActiveRecord
|
data/lib/schema_plus_views.rb
CHANGED
data/schema_dev.yml
CHANGED
data/schema_plus_views.gemspec
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
5
|
require 'schema_plus/views/version'
|
|
@@ -17,13 +18,13 @@ Gem::Specification.new do |gem|
|
|
|
17
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
18
19
|
gem.require_paths = ["lib"]
|
|
19
20
|
|
|
20
|
-
gem.
|
|
21
|
-
|
|
21
|
+
gem.required_ruby_version = '>= 2.5'
|
|
22
|
+
|
|
23
|
+
gem.add_dependency "activerecord", '>= 5.2', '< 6.1'
|
|
24
|
+
gem.add_dependency "schema_plus_core", '~> 3.0'
|
|
22
25
|
|
|
23
26
|
gem.add_development_dependency "bundler"
|
|
24
|
-
gem.add_development_dependency "rake",
|
|
25
|
-
gem.add_development_dependency "rspec",
|
|
26
|
-
gem.add_development_dependency "schema_dev",
|
|
27
|
-
gem.add_development_dependency "simplecov"
|
|
28
|
-
gem.add_development_dependency "simplecov-gem-profile"
|
|
27
|
+
gem.add_development_dependency "rake", '~> 13.0'
|
|
28
|
+
gem.add_development_dependency "rspec", '~> 3.0'
|
|
29
|
+
gem.add_development_dependency "schema_dev", '~> 4.1'
|
|
29
30
|
end
|
data/spec/dumper_spec.rb
CHANGED
data/spec/introspection_spec.rb
CHANGED
data/spec/middleware_spec.rb
CHANGED
data/spec/migration_spec.rb
CHANGED
data/spec/named_schemas_spec.rb
CHANGED
data/spec/sanity_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,43 +1,49 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: schema_plus_views
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ronen barzel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-05-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '5.2'
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '6.1'
|
|
20
23
|
type: :runtime
|
|
21
24
|
prerelease: false
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
26
|
requirements:
|
|
24
|
-
- - "
|
|
27
|
+
- - ">="
|
|
25
28
|
- !ruby/object:Gem::Version
|
|
26
29
|
version: '5.2'
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '6.1'
|
|
27
33
|
- !ruby/object:Gem::Dependency
|
|
28
34
|
name: schema_plus_core
|
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
|
30
36
|
requirements:
|
|
31
|
-
- - "
|
|
37
|
+
- - "~>"
|
|
32
38
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
39
|
+
version: '3.0'
|
|
34
40
|
type: :runtime
|
|
35
41
|
prerelease: false
|
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
43
|
requirements:
|
|
38
|
-
- - "
|
|
44
|
+
- - "~>"
|
|
39
45
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0'
|
|
46
|
+
version: '3.0'
|
|
41
47
|
- !ruby/object:Gem::Dependency
|
|
42
48
|
name: bundler
|
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -58,14 +64,14 @@ dependencies:
|
|
|
58
64
|
requirements:
|
|
59
65
|
- - "~>"
|
|
60
66
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '
|
|
67
|
+
version: '13.0'
|
|
62
68
|
type: :development
|
|
63
69
|
prerelease: false
|
|
64
70
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
71
|
requirements:
|
|
66
72
|
- - "~>"
|
|
67
73
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '
|
|
74
|
+
version: '13.0'
|
|
69
75
|
- !ruby/object:Gem::Dependency
|
|
70
76
|
name: rspec
|
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -86,42 +92,14 @@ dependencies:
|
|
|
86
92
|
requirements:
|
|
87
93
|
- - "~>"
|
|
88
94
|
- !ruby/object:Gem::Version
|
|
89
|
-
version:
|
|
95
|
+
version: '4.1'
|
|
90
96
|
type: :development
|
|
91
97
|
prerelease: false
|
|
92
98
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
99
|
requirements:
|
|
94
100
|
- - "~>"
|
|
95
101
|
- !ruby/object:Gem::Version
|
|
96
|
-
version:
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: simplecov
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - ">="
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - ">="
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0'
|
|
111
|
-
- !ruby/object:Gem::Dependency
|
|
112
|
-
name: simplecov-gem-profile
|
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
|
114
|
-
requirements:
|
|
115
|
-
- - ">="
|
|
116
|
-
- !ruby/object:Gem::Version
|
|
117
|
-
version: '0'
|
|
118
|
-
type: :development
|
|
119
|
-
prerelease: false
|
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
-
requirements:
|
|
122
|
-
- - ">="
|
|
123
|
-
- !ruby/object:Gem::Version
|
|
124
|
-
version: '0'
|
|
102
|
+
version: '4.1'
|
|
125
103
|
description:
|
|
126
104
|
email:
|
|
127
105
|
- ronen@barzel.org
|
|
@@ -129,8 +107,9 @@ executables: []
|
|
|
129
107
|
extensions: []
|
|
130
108
|
extra_rdoc_files: []
|
|
131
109
|
files:
|
|
110
|
+
- ".github/workflows/prs.yml"
|
|
132
111
|
- ".gitignore"
|
|
133
|
-
- ".
|
|
112
|
+
- ".simplecov"
|
|
134
113
|
- Gemfile
|
|
135
114
|
- LICENSE.txt
|
|
136
115
|
- README.md
|
|
@@ -140,6 +119,10 @@ files:
|
|
|
140
119
|
- gemfiles/activerecord-5.2/Gemfile.mysql2
|
|
141
120
|
- gemfiles/activerecord-5.2/Gemfile.postgresql
|
|
142
121
|
- gemfiles/activerecord-5.2/Gemfile.sqlite3
|
|
122
|
+
- gemfiles/activerecord-6.0/Gemfile.base
|
|
123
|
+
- gemfiles/activerecord-6.0/Gemfile.mysql2
|
|
124
|
+
- gemfiles/activerecord-6.0/Gemfile.postgresql
|
|
125
|
+
- gemfiles/activerecord-6.0/Gemfile.sqlite3
|
|
143
126
|
- lib/schema_plus/views.rb
|
|
144
127
|
- lib/schema_plus/views/active_record/connection_adapters/abstract_adapter.rb
|
|
145
128
|
- lib/schema_plus/views/active_record/connection_adapters/mysql2_adapter.rb
|
|
@@ -147,6 +130,7 @@ files:
|
|
|
147
130
|
- lib/schema_plus/views/active_record/connection_adapters/sqlite3_adapter.rb
|
|
148
131
|
- lib/schema_plus/views/active_record/migration/command_recorder.rb
|
|
149
132
|
- lib/schema_plus/views/middleware.rb
|
|
133
|
+
- lib/schema_plus/views/schema_dump.rb
|
|
150
134
|
- lib/schema_plus/views/version.rb
|
|
151
135
|
- lib/schema_plus_views.rb
|
|
152
136
|
- schema_dev.yml
|
|
@@ -170,7 +154,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
170
154
|
requirements:
|
|
171
155
|
- - ">="
|
|
172
156
|
- !ruby/object:Gem::Version
|
|
173
|
-
version: '
|
|
157
|
+
version: '2.5'
|
|
174
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
159
|
requirements:
|
|
176
160
|
- - ">="
|
data/.travis.yml
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by the schema_dev tool, based on the data in
|
|
2
|
-
# ./schema_dev.yml
|
|
3
|
-
# Please do not edit this file; any changes will be overwritten next time
|
|
4
|
-
# schema_dev gets run.
|
|
5
|
-
---
|
|
6
|
-
rvm:
|
|
7
|
-
- 2.5.9
|
|
8
|
-
- 2.7.3
|
|
9
|
-
gemfile:
|
|
10
|
-
- gemfiles/activerecord-5.2/Gemfile.sqlite3
|
|
11
|
-
before_script: bundle exec rake create_databases
|
|
12
|
-
after_script: bundle exec rake drop_databases
|
|
13
|
-
script: bundle exec rake travis
|
|
14
|
-
jobs:
|
|
15
|
-
include:
|
|
16
|
-
- gemfile: gemfiles/activerecord-5.2/Gemfile.mysql2
|
|
17
|
-
rvm: 2.5.9
|
|
18
|
-
services:
|
|
19
|
-
- mysql
|
|
20
|
-
env: MYSQL_DB_USER=travis
|
|
21
|
-
- gemfile: gemfiles/activerecord-5.2/Gemfile.postgresql
|
|
22
|
-
rvm: 2.5.9
|
|
23
|
-
addons:
|
|
24
|
-
postgresql: '10'
|
|
25
|
-
apt:
|
|
26
|
-
packages:
|
|
27
|
-
- postgresql-10
|
|
28
|
-
- postgresql-client-10
|
|
29
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
30
|
-
- gemfile: gemfiles/activerecord-5.2/Gemfile.postgresql
|
|
31
|
-
rvm: 2.5.9
|
|
32
|
-
addons:
|
|
33
|
-
postgresql: '11'
|
|
34
|
-
apt:
|
|
35
|
-
packages:
|
|
36
|
-
- postgresql-11
|
|
37
|
-
- postgresql-client-11
|
|
38
|
-
env: POSTGRESQL_DB_USER=travis PGPORT=5433
|
|
39
|
-
- gemfile: gemfiles/activerecord-5.2/Gemfile.postgresql
|
|
40
|
-
rvm: 2.5.9
|
|
41
|
-
addons:
|
|
42
|
-
postgresql: '12'
|
|
43
|
-
apt:
|
|
44
|
-
packages:
|
|
45
|
-
- postgresql-12
|
|
46
|
-
- postgresql-client-12
|
|
47
|
-
env: POSTGRESQL_DB_USER=travis PGPORT=5433
|
|
48
|
-
- gemfile: gemfiles/activerecord-5.2/Gemfile.postgresql
|
|
49
|
-
rvm: 2.5.9
|
|
50
|
-
addons:
|
|
51
|
-
postgresql: '9.6'
|
|
52
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
53
|
-
- gemfile: gemfiles/activerecord-5.2/Gemfile.mysql2
|
|
54
|
-
rvm: 2.7.3
|
|
55
|
-
services:
|
|
56
|
-
- mysql
|
|
57
|
-
env: MYSQL_DB_USER=travis
|
|
58
|
-
- gemfile: gemfiles/activerecord-5.2/Gemfile.postgresql
|
|
59
|
-
rvm: 2.7.3
|
|
60
|
-
addons:
|
|
61
|
-
postgresql: '11'
|
|
62
|
-
apt:
|
|
63
|
-
packages:
|
|
64
|
-
- postgresql-11
|
|
65
|
-
- postgresql-client-11
|
|
66
|
-
env: POSTGRESQL_DB_USER=travis PGPORT=5433
|
|
67
|
-
- gemfile: gemfiles/activerecord-5.2/Gemfile.postgresql
|
|
68
|
-
rvm: 2.7.3
|
|
69
|
-
addons:
|
|
70
|
-
postgresql: '12'
|
|
71
|
-
apt:
|
|
72
|
-
packages:
|
|
73
|
-
- postgresql-12
|
|
74
|
-
- postgresql-client-12
|
|
75
|
-
env: POSTGRESQL_DB_USER=travis PGPORT=5433
|
|
76
|
-
- gemfile: gemfiles/activerecord-5.2/Gemfile.postgresql
|
|
77
|
-
rvm: 2.7.3
|
|
78
|
-
addons:
|
|
79
|
-
postgresql: '10'
|
|
80
|
-
apt:
|
|
81
|
-
packages:
|
|
82
|
-
- postgresql-10
|
|
83
|
-
- postgresql-client-10
|
|
84
|
-
env: POSTGRESQL_DB_USER=postgres
|
|
85
|
-
- gemfile: gemfiles/activerecord-5.2/Gemfile.postgresql
|
|
86
|
-
rvm: 2.7.3
|
|
87
|
-
addons:
|
|
88
|
-
postgresql: '9.6'
|
|
89
|
-
env: POSTGRESQL_DB_USER=postgres
|