baza_migrations 0.0.1 → 0.0.3
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 +5 -5
- data/README.md +6 -1
- data/Rakefile +2 -16
- data/lib/baza_migrations/commands/add_index.rb +1 -0
- data/lib/baza_migrations/commands/create_table.rb +5 -5
- data/lib/baza_migrations/errors.rb +1 -0
- data/lib/baza_migrations/migrate.rb +2 -1
- data/lib/baza_migrations/migration.rb +9 -8
- data/lib/baza_migrations/migrations_executor.rb +6 -5
- data/lib/baza_migrations.rb +4 -2
- data/lib/tasks/baza.rake +2 -0
- metadata +70 -45
- data/.document +0 -5
- data/.rspec +0 -1
- data/.rubocop_todo.yml +0 -9
- data/Gemfile +0 -27
- data/Gemfile.lock +0 -153
- data/VERSION +0 -1
- data/baza_migrations.gemspec +0 -111
- data/shippable.yml +0 -11
- data/spec/dummy/db/baza_migrate/20150901160500_create_users.rb +0 -9
- data/spec/dummy/db/baza_migrate/20150901161800_create_user_roles.rb +0 -11
- data/spec/lib/baza_migrations/migration_spec.rb +0 -74
- data/spec/lib/baza_migrations/migrations_executor_spec.rb +0 -38
- data/spec/spec_helper.rb +0 -23
- data/spec/test_classes/201503041644_test_change_migration.rb +0 -13
- data/spec/test_classes/201503041646_test_up_down_migration.rb +0 -20
- data/spec/test_classes/201509101727_test_exists_methods.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 077042b1154a646175ab0dafae56b95d59e701217c39d8844c176b7e2756cb35
|
4
|
+
data.tar.gz: 0d3ee44dd6df4be861aa21a023d58cdd2efb797d4e603e9feef6d0986d4f7768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bc86dbae229ef38c317f6644d0189f97f37ca8622b0621e5a8843514c8a332422ca56035322e6022126043b9b6e3a4fb36ce6483cf0518e8da55b69665199f1
|
7
|
+
data.tar.gz: 6ad76fda70128b07b10a56533da8b95f61899d83cf106c81a069eaf68abe089584a48bd5ccea24e8b5c3208fe424b6530e22ae8fc94d2c5878560885cc8ec19f
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
[](https://app.shippable.com/projects/54f837035ab6cc135292f855/builds/latest)
|
2
1
|
[](https://codeclimate.com/github/kaspernj/baza_migrations)
|
3
2
|
[](https://codeclimate.com/github/kaspernj/baza_migrations)
|
3
|
+
[](https://app.shippable.com/projects/54f837035ab6cc135292f855/builds/latest)
|
4
4
|
|
5
5
|
# baza_migrations
|
6
6
|
|
@@ -14,6 +14,11 @@ executor.add_dir("spec/dummy/db/baza_migrate")
|
|
14
14
|
executor.execute_migrations
|
15
15
|
```
|
16
16
|
|
17
|
+
```bash
|
18
|
+
rake baza:db:migrate
|
19
|
+
rake baza:db:rollback
|
20
|
+
```
|
21
|
+
|
17
22
|
## Contributing to baza_migrations
|
18
23
|
|
19
24
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
data/Rakefile
CHANGED
@@ -3,26 +3,12 @@ require "bundler"
|
|
3
3
|
begin
|
4
4
|
Bundler.setup(:default, :development)
|
5
5
|
rescue Bundler::BundlerError => e
|
6
|
-
|
7
|
-
|
6
|
+
warn e.message
|
7
|
+
warn "Run `bundle install` to install missing gems"
|
8
8
|
exit e.status_code
|
9
9
|
end
|
10
10
|
require "rake"
|
11
11
|
|
12
|
-
require "jeweler"
|
13
|
-
Jeweler::Tasks.new do |gem|
|
14
|
-
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
15
|
-
gem.name = "baza_migrations"
|
16
|
-
gem.homepage = "http://github.com/kaspernj/baza_migrations"
|
17
|
-
gem.license = "MIT"
|
18
|
-
gem.summary = %(Migrations support for the Baza database framework in Ruby.)
|
19
|
-
gem.description = %(Migrations support for the Baza database framework in Ruby.)
|
20
|
-
gem.email = "k@spernj.org"
|
21
|
-
gem.authors = ["kaspernj"]
|
22
|
-
# dependencies defined in Gemfile
|
23
|
-
end
|
24
|
-
Jeweler::RubygemsDotOrgTasks.new
|
25
|
-
|
26
12
|
require "rspec/core"
|
27
13
|
require "rspec/core/rake_task"
|
28
14
|
RSpec::Core::RakeTask.new(:spec) do |spec|
|
@@ -7,15 +7,15 @@ class BazaMigrations::Commands::CreateTable < BazaMigrations::Commands::Base
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def string(name, args = {})
|
10
|
-
@columns << {name
|
10
|
+
@columns << {name:, type: :string}.merge(default_args(args))
|
11
11
|
end
|
12
12
|
|
13
13
|
def text(name, args = {})
|
14
|
-
@columns << {name
|
14
|
+
@columns << {name:, type: :text}.merge(default_args(args))
|
15
15
|
end
|
16
16
|
|
17
17
|
def integer(name, args = {})
|
18
|
-
@columns << {name
|
18
|
+
@columns << {name:, type: :int}.merge(default_args(args))
|
19
19
|
end
|
20
20
|
|
21
21
|
def timestamps(args = {})
|
@@ -28,11 +28,11 @@ class BazaMigrations::Commands::CreateTable < BazaMigrations::Commands::Base
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def datetime(name, args = {})
|
31
|
-
@columns << {name
|
31
|
+
@columns << {name:, type: :datetime}.merge(default_args(args))
|
32
32
|
end
|
33
33
|
|
34
34
|
def sql
|
35
|
-
db.tables.create(@name,
|
35
|
+
db.tables.create(@name, columns: @columns, return_sql: true)
|
36
36
|
end
|
37
37
|
|
38
38
|
def changed_rollback_sql
|
@@ -5,6 +5,7 @@ class BazaMigrations::Migrate
|
|
5
5
|
paths.each do |path|
|
6
6
|
migrations_path = "#{path}/db/baza_migrate"
|
7
7
|
next unless File.exist?(migrations_path)
|
8
|
+
|
8
9
|
executor.add_dir(migrations_path)
|
9
10
|
end
|
10
11
|
|
@@ -19,7 +20,7 @@ class BazaMigrations::Migrate
|
|
19
20
|
Enumerator.new do |yielder|
|
20
21
|
yielder << Dir.pwd
|
21
22
|
|
22
|
-
Gem.loaded_specs.
|
23
|
+
Gem.loaded_specs.each_value do |loaded_spec|
|
23
24
|
yielder << loaded_spec.gem_dir
|
24
25
|
end
|
25
26
|
end
|
@@ -2,6 +2,7 @@ class BazaMigrations::Migration
|
|
2
2
|
def initialize(args = {})
|
3
3
|
@db = args.fetch(:db)
|
4
4
|
raise "No database was given" unless @db
|
5
|
+
|
5
6
|
@changes = []
|
6
7
|
end
|
7
8
|
|
@@ -72,16 +73,16 @@ private
|
|
72
73
|
|
73
74
|
def table_exists?(table_name)
|
74
75
|
@db.tables[table_name]
|
75
|
-
|
76
|
+
true
|
76
77
|
rescue Errno::ENOENT
|
77
|
-
|
78
|
+
false
|
78
79
|
end
|
79
80
|
|
80
81
|
def column_exists?(table_name, column_name)
|
81
82
|
@db.tables[table_name].column(column_name)
|
82
|
-
|
83
|
+
true
|
83
84
|
rescue Errno::ENOENT
|
84
|
-
|
85
|
+
false
|
85
86
|
end
|
86
87
|
|
87
88
|
def index_exists?(table_name, column_names)
|
@@ -90,9 +91,9 @@ private
|
|
90
91
|
|
91
92
|
begin
|
92
93
|
@db.tables[table_name].index(index_name)
|
93
|
-
|
94
|
+
true
|
94
95
|
rescue Errno::ENOENT
|
95
|
-
|
96
|
+
false
|
96
97
|
end
|
97
98
|
end
|
98
99
|
|
@@ -126,8 +127,8 @@ protected
|
|
126
127
|
end
|
127
128
|
end
|
128
129
|
|
129
|
-
def new_command(type, *
|
130
|
-
command = BazaMigrations::Commands.const_get(type).new(*
|
130
|
+
def new_command(type, *)
|
131
|
+
command = BazaMigrations::Commands.const_get(type).new(*)
|
131
132
|
command.db = @db
|
132
133
|
command.table = @schema_migrations_table
|
133
134
|
|
@@ -9,6 +9,7 @@ class BazaMigrations::MigrationsExecutor
|
|
9
9
|
|
10
10
|
Dir.foreach(path) do |file|
|
11
11
|
next unless file.end_with?(".rb")
|
12
|
+
|
12
13
|
full_path = "#{path}/#{file}"
|
13
14
|
add_file(full_path)
|
14
15
|
end
|
@@ -22,7 +23,7 @@ class BazaMigrations::MigrationsExecutor
|
|
22
23
|
class_name = StringCases.snake_to_camel(File.basename(match[2], File.extname(path)))
|
23
24
|
|
24
25
|
add_migration(
|
25
|
-
class_name
|
26
|
+
class_name:,
|
26
27
|
const: Object.const_get(class_name),
|
27
28
|
time: Time.parse(match[1])
|
28
29
|
)
|
@@ -56,9 +57,9 @@ class BazaMigrations::MigrationsExecutor
|
|
56
57
|
|
57
58
|
def migration_already_executed?(migration_data)
|
58
59
|
if @db.single(:baza_schema_migrations, version: migration_data.fetch(:time).strftime("%Y%m%d%H%M%S"))
|
59
|
-
|
60
|
+
true
|
60
61
|
else
|
61
|
-
|
62
|
+
false
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
@@ -80,8 +81,8 @@ private
|
|
80
81
|
|
81
82
|
def schema_migrations_table_exist?
|
82
83
|
@db.tables[:baza_schema_migrations]
|
83
|
-
|
84
|
+
true
|
84
85
|
rescue Baza::Errors::TableNotFound
|
85
|
-
|
86
|
+
false
|
86
87
|
end
|
87
88
|
end
|
data/lib/baza_migrations.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
require "baza"
|
2
2
|
require "auto_autoloader"
|
3
3
|
|
4
|
-
load "#{File.dirname(__FILE__)}/tasks/baza.rake" if ::Kernel.const_defined?(:Rake)
|
5
|
-
|
6
4
|
class BazaMigrations
|
7
5
|
AutoAutoloader.autoload_sub_classes(self, __FILE__)
|
6
|
+
|
7
|
+
def self.load_tasks
|
8
|
+
load "#{File.dirname(__FILE__)}/tasks/baza.rake"
|
9
|
+
end
|
8
10
|
end
|
data/lib/tasks/baza.rake
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
namespace :baza do
|
2
2
|
namespace :db do
|
3
|
+
desc "Runs all missing migrations"
|
3
4
|
task "migrate" do
|
4
5
|
BazaMigrations::Migrate.new.execute_all_migrations(:up)
|
5
6
|
end
|
6
7
|
|
8
|
+
desc "Runs all migrations back?"
|
7
9
|
task "rollback" do
|
8
10
|
BazaMigrations::Migrate.new.execute_all_migrations(:down)
|
9
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baza_migrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kaspernj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: baza
|
@@ -67,61 +67,61 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 3.5.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 3.5.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: rdoc
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: bundler
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 2.
|
117
|
+
version: 2.3.4
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 2.
|
124
|
+
version: 2.3.4
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: jdbc-sqlite3
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,16 +140,16 @@ dependencies:
|
|
140
140
|
name: sqlite3
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - '='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: 1.4.4
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: 1.4.4
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: wref
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -166,6 +166,20 @@ dependencies:
|
|
166
166
|
version: 0.0.8
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rubocop
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - '='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 1.75.1
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - '='
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 1.75.1
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: rubocop-performance
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
170
184
|
requirements:
|
171
185
|
- - ">="
|
@@ -179,7 +193,21 @@ dependencies:
|
|
179
193
|
- !ruby/object:Gem::Version
|
180
194
|
version: '0'
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
196
|
+
name: rubocop-rake
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: rubocop-rspec
|
183
211
|
requirement: !ruby/object:Gem::Requirement
|
184
212
|
requirements:
|
185
213
|
- - ">="
|
@@ -192,6 +220,20 @@ dependencies:
|
|
192
220
|
- - ">="
|
193
221
|
- !ruby/object:Gem::Version
|
194
222
|
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: best_practice_project
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - '='
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: 0.0.10
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - '='
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: 0.0.10
|
195
237
|
description: Migrations support for the Baza database framework in Ruby.
|
196
238
|
email: k@spernj.org
|
197
239
|
executables: []
|
@@ -200,16 +242,9 @@ extra_rdoc_files:
|
|
200
242
|
- LICENSE.txt
|
201
243
|
- README.md
|
202
244
|
files:
|
203
|
-
- ".document"
|
204
|
-
- ".rspec"
|
205
|
-
- ".rubocop_todo.yml"
|
206
|
-
- Gemfile
|
207
|
-
- Gemfile.lock
|
208
245
|
- LICENSE.txt
|
209
246
|
- README.md
|
210
247
|
- Rakefile
|
211
|
-
- VERSION
|
212
|
-
- baza_migrations.gemspec
|
213
248
|
- config/best_project_practice_rubocop.yml
|
214
249
|
- config/best_project_practice_rubocop_todo.yml
|
215
250
|
- lib/baza_migrations.rb
|
@@ -226,15 +261,6 @@ files:
|
|
226
261
|
- lib/baza_migrations/migration.rb
|
227
262
|
- lib/baza_migrations/migrations_executor.rb
|
228
263
|
- lib/tasks/baza.rake
|
229
|
-
- shippable.yml
|
230
|
-
- spec/dummy/db/baza_migrate/20150901160500_create_users.rb
|
231
|
-
- spec/dummy/db/baza_migrate/20150901161800_create_user_roles.rb
|
232
|
-
- spec/lib/baza_migrations/migration_spec.rb
|
233
|
-
- spec/lib/baza_migrations/migrations_executor_spec.rb
|
234
|
-
- spec/spec_helper.rb
|
235
|
-
- spec/test_classes/201503041644_test_change_migration.rb
|
236
|
-
- spec/test_classes/201503041646_test_up_down_migration.rb
|
237
|
-
- spec/test_classes/201509101727_test_exists_methods.rb
|
238
264
|
homepage: http://github.com/kaspernj/baza_migrations
|
239
265
|
licenses:
|
240
266
|
- MIT
|
@@ -254,8 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
280
|
- !ruby/object:Gem::Version
|
255
281
|
version: '0'
|
256
282
|
requirements: []
|
257
|
-
|
258
|
-
rubygems_version: 2.4.0
|
283
|
+
rubygems_version: 3.4.10
|
259
284
|
signing_key:
|
260
285
|
specification_version: 4
|
261
286
|
summary: Migrations support for the Baza database framework in Ruby.
|
data/.document
DELETED
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color
|
data/.rubocop_todo.yml
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# This configuration was generated by
|
4
|
-
# `rubocop --auto-gen-config`
|
5
|
-
# on 2015-12-20 17:49:37 +0100 using RuboCop version 0.35.1.
|
6
|
-
# The point is for the user to remove these configuration records
|
7
|
-
# one by one as the offenses are removed from the code base.
|
8
|
-
# Note that changes in the inspected code, or installation of new
|
9
|
-
# versions of RuboCop, may require this file to be generated again.
|
data/Gemfile
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
source "http://rubygems.org"
|
2
|
-
# Add dependencies required to use your gem here.
|
3
|
-
# Example:
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
5
|
-
|
6
|
-
gem "baza", "~> 0.0.20"
|
7
|
-
gem "string-cases", "~> 0.0.1"
|
8
|
-
gem "auto_autoloader"
|
9
|
-
|
10
|
-
# Add dependencies to develop your gem here.
|
11
|
-
# Include everything needed to run rake, tests, features, etc.
|
12
|
-
group :development do
|
13
|
-
gem "pry"
|
14
|
-
gem "rspec", "~> 3.3.0"
|
15
|
-
gem "rdoc", "~> 3.12"
|
16
|
-
gem "bundler", "~> 1.0"
|
17
|
-
gem "jeweler", "~> 2.0.1"
|
18
|
-
gem "jdbc-sqlite3", platform: :jruby
|
19
|
-
gem "sqlite3", platform: :ruby
|
20
|
-
gem "wref", "0.0.8"
|
21
|
-
gem "rubocop", require: false
|
22
|
-
gem "best_practice_project", require: false, github: "kaspernj/best_practice_project"
|
23
|
-
end
|
24
|
-
|
25
|
-
group :test do
|
26
|
-
gem "codeclimate-test-reporter", group: :test, require: nil
|
27
|
-
end
|
data/Gemfile.lock
DELETED
@@ -1,153 +0,0 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/kaspernj/best_practice_project.git
|
3
|
-
revision: 63faed5527c52b4e0196fcca726df25dc31e0341
|
4
|
-
specs:
|
5
|
-
best_practice_project (0.0.5)
|
6
|
-
psych (~> 2.0.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: http://rubygems.org/
|
10
|
-
specs:
|
11
|
-
addressable (2.3.7)
|
12
|
-
array_enumerator (0.0.10)
|
13
|
-
ast (2.2.0)
|
14
|
-
astrolabe (1.3.1)
|
15
|
-
parser (~> 2.2)
|
16
|
-
auto_autoloader (0.0.1)
|
17
|
-
string-cases
|
18
|
-
baza (0.0.20)
|
19
|
-
array_enumerator (~> 0.0.10)
|
20
|
-
datet (~> 0.0.25)
|
21
|
-
event_handler (~> 0.0.0)
|
22
|
-
string-cases (~> 0.0.1)
|
23
|
-
wref (~> 0.0.8)
|
24
|
-
builder (3.2.2)
|
25
|
-
codeclimate-test-reporter (0.4.6)
|
26
|
-
simplecov (>= 0.7.1, < 1.0.0)
|
27
|
-
coderay (1.1.0)
|
28
|
-
datet (0.0.25)
|
29
|
-
descendants_tracker (0.0.4)
|
30
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
31
|
-
diff-lcs (1.2.5)
|
32
|
-
docile (1.1.5)
|
33
|
-
event_handler (0.0.0)
|
34
|
-
faraday (0.9.1)
|
35
|
-
multipart-post (>= 1.2, < 3)
|
36
|
-
ffi (1.9.10-java)
|
37
|
-
git (1.2.9.1)
|
38
|
-
github_api (0.12.3)
|
39
|
-
addressable (~> 2.3)
|
40
|
-
descendants_tracker (~> 0.0.4)
|
41
|
-
faraday (~> 0.8, < 0.10)
|
42
|
-
hashie (>= 3.3)
|
43
|
-
multi_json (>= 1.7.5, < 2.0)
|
44
|
-
nokogiri (~> 1.6.3)
|
45
|
-
oauth2
|
46
|
-
hashie (3.4.0)
|
47
|
-
highline (1.7.1)
|
48
|
-
jar-dependencies (0.3.1)
|
49
|
-
jdbc-sqlite3 (3.8.10.1)
|
50
|
-
jeweler (2.0.1)
|
51
|
-
builder
|
52
|
-
bundler (>= 1.0)
|
53
|
-
git (>= 1.2.5)
|
54
|
-
github_api
|
55
|
-
highline (>= 1.6.15)
|
56
|
-
nokogiri (>= 1.5.10)
|
57
|
-
rake
|
58
|
-
rdoc
|
59
|
-
json (1.8.2)
|
60
|
-
json (1.8.2-java)
|
61
|
-
jwt (1.3.0)
|
62
|
-
method_source (0.8.2)
|
63
|
-
mini_portile (0.6.2)
|
64
|
-
multi_json (1.11.0)
|
65
|
-
multi_xml (0.5.5)
|
66
|
-
multipart-post (2.0.0)
|
67
|
-
nokogiri (1.6.6.2)
|
68
|
-
mini_portile (~> 0.6.0)
|
69
|
-
nokogiri (1.6.6.2-java)
|
70
|
-
oauth2 (1.0.0)
|
71
|
-
faraday (>= 0.8, < 0.10)
|
72
|
-
jwt (~> 1.0)
|
73
|
-
multi_json (~> 1.3)
|
74
|
-
multi_xml (~> 0.5)
|
75
|
-
rack (~> 1.2)
|
76
|
-
parser (2.2.3.0)
|
77
|
-
ast (>= 1.1, < 3.0)
|
78
|
-
powerpack (0.1.1)
|
79
|
-
pry (0.10.1)
|
80
|
-
coderay (~> 1.1.0)
|
81
|
-
method_source (~> 0.8.1)
|
82
|
-
slop (~> 3.4)
|
83
|
-
pry (0.10.1-java)
|
84
|
-
coderay (~> 1.1.0)
|
85
|
-
method_source (~> 0.8.1)
|
86
|
-
slop (~> 3.4)
|
87
|
-
spoon (~> 0.0)
|
88
|
-
psych (2.0.16)
|
89
|
-
psych (2.0.16-java)
|
90
|
-
jar-dependencies (>= 0.1.7)
|
91
|
-
rack (1.6.0)
|
92
|
-
rainbow (2.0.0)
|
93
|
-
rake (10.4.2)
|
94
|
-
rdoc (3.12.2)
|
95
|
-
json (~> 1.4)
|
96
|
-
rspec (3.3.0)
|
97
|
-
rspec-core (~> 3.3.0)
|
98
|
-
rspec-expectations (~> 3.3.0)
|
99
|
-
rspec-mocks (~> 3.3.0)
|
100
|
-
rspec-core (3.3.2)
|
101
|
-
rspec-support (~> 3.3.0)
|
102
|
-
rspec-expectations (3.3.1)
|
103
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
104
|
-
rspec-support (~> 3.3.0)
|
105
|
-
rspec-mocks (3.3.2)
|
106
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
107
|
-
rspec-support (~> 3.3.0)
|
108
|
-
rspec-support (3.3.0)
|
109
|
-
rubocop (0.35.1)
|
110
|
-
astrolabe (~> 1.3)
|
111
|
-
parser (>= 2.2.3.0, < 3.0)
|
112
|
-
powerpack (~> 0.1)
|
113
|
-
rainbow (>= 1.99.1, < 3.0)
|
114
|
-
ruby-progressbar (~> 1.7)
|
115
|
-
tins (<= 1.6.0)
|
116
|
-
ruby-progressbar (1.7.5)
|
117
|
-
simplecov (0.9.2)
|
118
|
-
docile (~> 1.1.0)
|
119
|
-
multi_json (~> 1.0)
|
120
|
-
simplecov-html (~> 0.9.0)
|
121
|
-
simplecov-html (0.9.0)
|
122
|
-
slop (3.6.0)
|
123
|
-
spoon (0.0.4)
|
124
|
-
ffi
|
125
|
-
sqlite3 (1.3.10)
|
126
|
-
string-cases (0.0.1)
|
127
|
-
thread_safe (0.3.4)
|
128
|
-
thread_safe (0.3.4-java)
|
129
|
-
tins (1.6.0)
|
130
|
-
wref (0.0.8)
|
131
|
-
|
132
|
-
PLATFORMS
|
133
|
-
java
|
134
|
-
ruby
|
135
|
-
|
136
|
-
DEPENDENCIES
|
137
|
-
auto_autoloader
|
138
|
-
baza (~> 0.0.20)
|
139
|
-
best_practice_project!
|
140
|
-
bundler (~> 1.0)
|
141
|
-
codeclimate-test-reporter
|
142
|
-
jdbc-sqlite3
|
143
|
-
jeweler (~> 2.0.1)
|
144
|
-
pry
|
145
|
-
rdoc (~> 3.12)
|
146
|
-
rspec (~> 3.3.0)
|
147
|
-
rubocop
|
148
|
-
sqlite3
|
149
|
-
string-cases (~> 0.0.1)
|
150
|
-
wref (= 0.0.8)
|
151
|
-
|
152
|
-
BUNDLED WITH
|
153
|
-
1.11.2
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.0.1
|
data/baza_migrations.gemspec
DELETED
@@ -1,111 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: baza_migrations 0.0.1 ruby lib
|
6
|
-
|
7
|
-
Gem::Specification.new do |s|
|
8
|
-
s.name = "baza_migrations"
|
9
|
-
s.version = "0.0.1"
|
10
|
-
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib"]
|
13
|
-
s.authors = ["kaspernj"]
|
14
|
-
s.date = "2016-01-06"
|
15
|
-
s.description = "Migrations support for the Baza database framework in Ruby."
|
16
|
-
s.email = "k@spernj.org"
|
17
|
-
s.extra_rdoc_files = [
|
18
|
-
"LICENSE.txt",
|
19
|
-
"README.md"
|
20
|
-
]
|
21
|
-
s.files = [
|
22
|
-
".document",
|
23
|
-
".rspec",
|
24
|
-
".rubocop_todo.yml",
|
25
|
-
"Gemfile",
|
26
|
-
"Gemfile.lock",
|
27
|
-
"LICENSE.txt",
|
28
|
-
"README.md",
|
29
|
-
"Rakefile",
|
30
|
-
"VERSION",
|
31
|
-
"baza_migrations.gemspec",
|
32
|
-
"config/best_project_practice_rubocop.yml",
|
33
|
-
"config/best_project_practice_rubocop_todo.yml",
|
34
|
-
"lib/baza_migrations.rb",
|
35
|
-
"lib/baza_migrations/commands.rb",
|
36
|
-
"lib/baza_migrations/commands/add_column.rb",
|
37
|
-
"lib/baza_migrations/commands/add_index.rb",
|
38
|
-
"lib/baza_migrations/commands/base.rb",
|
39
|
-
"lib/baza_migrations/commands/create_table.rb",
|
40
|
-
"lib/baza_migrations/commands/drop_table.rb",
|
41
|
-
"lib/baza_migrations/commands/remove_column.rb",
|
42
|
-
"lib/baza_migrations/commands/remove_index.rb",
|
43
|
-
"lib/baza_migrations/errors.rb",
|
44
|
-
"lib/baza_migrations/migrate.rb",
|
45
|
-
"lib/baza_migrations/migration.rb",
|
46
|
-
"lib/baza_migrations/migrations_executor.rb",
|
47
|
-
"lib/tasks/baza.rake",
|
48
|
-
"shippable.yml",
|
49
|
-
"spec/dummy/db/baza_migrate/20150901160500_create_users.rb",
|
50
|
-
"spec/dummy/db/baza_migrate/20150901161800_create_user_roles.rb",
|
51
|
-
"spec/lib/baza_migrations/migration_spec.rb",
|
52
|
-
"spec/lib/baza_migrations/migrations_executor_spec.rb",
|
53
|
-
"spec/spec_helper.rb",
|
54
|
-
"spec/test_classes/201503041644_test_change_migration.rb",
|
55
|
-
"spec/test_classes/201503041646_test_up_down_migration.rb",
|
56
|
-
"spec/test_classes/201509101727_test_exists_methods.rb"
|
57
|
-
]
|
58
|
-
s.homepage = "http://github.com/kaspernj/baza_migrations"
|
59
|
-
s.licenses = ["MIT"]
|
60
|
-
s.rubygems_version = "2.4.0"
|
61
|
-
s.summary = "Migrations support for the Baza database framework in Ruby."
|
62
|
-
|
63
|
-
if s.respond_to? :specification_version then
|
64
|
-
s.specification_version = 4
|
65
|
-
|
66
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
67
|
-
s.add_runtime_dependency(%q<baza>, ["~> 0.0.20"])
|
68
|
-
s.add_runtime_dependency(%q<string-cases>, ["~> 0.0.1"])
|
69
|
-
s.add_runtime_dependency(%q<auto_autoloader>, [">= 0"])
|
70
|
-
s.add_development_dependency(%q<pry>, [">= 0"])
|
71
|
-
s.add_development_dependency(%q<rspec>, ["~> 3.3.0"])
|
72
|
-
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
73
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
74
|
-
s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
|
75
|
-
s.add_development_dependency(%q<jdbc-sqlite3>, [">= 0"])
|
76
|
-
s.add_development_dependency(%q<sqlite3>, [">= 0"])
|
77
|
-
s.add_development_dependency(%q<wref>, ["= 0.0.8"])
|
78
|
-
s.add_development_dependency(%q<rubocop>, [">= 0"])
|
79
|
-
s.add_development_dependency(%q<best_practice_project>, [">= 0"])
|
80
|
-
else
|
81
|
-
s.add_dependency(%q<baza>, ["~> 0.0.20"])
|
82
|
-
s.add_dependency(%q<string-cases>, ["~> 0.0.1"])
|
83
|
-
s.add_dependency(%q<auto_autoloader>, [">= 0"])
|
84
|
-
s.add_dependency(%q<pry>, [">= 0"])
|
85
|
-
s.add_dependency(%q<rspec>, ["~> 3.3.0"])
|
86
|
-
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
87
|
-
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
88
|
-
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
89
|
-
s.add_dependency(%q<jdbc-sqlite3>, [">= 0"])
|
90
|
-
s.add_dependency(%q<sqlite3>, [">= 0"])
|
91
|
-
s.add_dependency(%q<wref>, ["= 0.0.8"])
|
92
|
-
s.add_dependency(%q<rubocop>, [">= 0"])
|
93
|
-
s.add_dependency(%q<best_practice_project>, [">= 0"])
|
94
|
-
end
|
95
|
-
else
|
96
|
-
s.add_dependency(%q<baza>, ["~> 0.0.20"])
|
97
|
-
s.add_dependency(%q<string-cases>, ["~> 0.0.1"])
|
98
|
-
s.add_dependency(%q<auto_autoloader>, [">= 0"])
|
99
|
-
s.add_dependency(%q<pry>, [">= 0"])
|
100
|
-
s.add_dependency(%q<rspec>, ["~> 3.3.0"])
|
101
|
-
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
102
|
-
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
103
|
-
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
104
|
-
s.add_dependency(%q<jdbc-sqlite3>, [">= 0"])
|
105
|
-
s.add_dependency(%q<sqlite3>, [">= 0"])
|
106
|
-
s.add_dependency(%q<wref>, ["= 0.0.8"])
|
107
|
-
s.add_dependency(%q<rubocop>, [">= 0"])
|
108
|
-
s.add_dependency(%q<best_practice_project>, [">= 0"])
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
data/shippable.yml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
archive: true
|
4
|
-
rvm:
|
5
|
-
- ruby-2.1.2
|
6
|
-
- jruby-1.7.13
|
7
|
-
script:
|
8
|
-
- CODECLIMATE_REPO_TOKEN=e1264b88c223370b3592637fc05e848591579981acb2463540a5b9855db2fadd bundle exec rspec
|
9
|
-
- bundle exec rake best_practice_project:run
|
10
|
-
notifications:
|
11
|
-
email: false
|
@@ -1,74 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe BazaMigrations::Migration do
|
4
|
-
let(:db) do
|
5
|
-
file_path = "#{Dir.tmpdir}/baza_migrations.sqlite3"
|
6
|
-
File.unlink(file_path) if File.exist?(file_path)
|
7
|
-
Baza::Db.new(type: :sqlite3, path: file_path, debug: false)
|
8
|
-
end
|
9
|
-
|
10
|
-
let(:executor) { BazaMigrations::MigrationsExecutor.new(db: db) }
|
11
|
-
|
12
|
-
let(:change_migration) do
|
13
|
-
require "#{File.dirname(__FILE__)}/../../test_classes/201503041644_test_change_migration.rb"
|
14
|
-
TestChangeMigration.new(db: db)
|
15
|
-
end
|
16
|
-
|
17
|
-
let(:up_down_migration) do
|
18
|
-
require "#{File.dirname(__FILE__)}/../../test_classes/201503041646_test_up_down_migration.rb"
|
19
|
-
TestUpDownMigration.new(db: db)
|
20
|
-
end
|
21
|
-
|
22
|
-
let(:test_exists_migration) do
|
23
|
-
require "#{File.dirname(__FILE__)}/../../test_classes/201509101727_test_exists_methods.rb"
|
24
|
-
TestExistsMethods.new(db: db)
|
25
|
-
end
|
26
|
-
|
27
|
-
it "#up" do
|
28
|
-
up_down_migration.migrate(:up)
|
29
|
-
|
30
|
-
table = db.tables[:test_table]
|
31
|
-
expect(table.name).to eq "test_table"
|
32
|
-
|
33
|
-
age_column = table.column(:age)
|
34
|
-
expect(age_column.type).to eq :int
|
35
|
-
end
|
36
|
-
|
37
|
-
it "#down" do
|
38
|
-
up_down_migration.migrate(:up)
|
39
|
-
|
40
|
-
table = db.tables[:test_table]
|
41
|
-
expect(table.name).to eq "test_table"
|
42
|
-
|
43
|
-
up_down_migration.migrate(:down)
|
44
|
-
db.tables.instance_variable_set(:@list, Wref::Map.new) # Resets cache
|
45
|
-
|
46
|
-
expect { db.tables[:test_table] }.to raise_error(Baza::Errors::TableNotFound)
|
47
|
-
end
|
48
|
-
|
49
|
-
describe "#change" do
|
50
|
-
it "migrates" do
|
51
|
-
change_migration.migrate(:up)
|
52
|
-
table = db.tables[:table]
|
53
|
-
expect(table.name).to eq "table"
|
54
|
-
end
|
55
|
-
|
56
|
-
it "rolls back" do
|
57
|
-
change_migration.migrate(:up)
|
58
|
-
table = db.tables[:table]
|
59
|
-
expect(table.name).to eq "table"
|
60
|
-
|
61
|
-
expect(table.columns.length).to eq 6
|
62
|
-
|
63
|
-
change_migration.migrate(:down)
|
64
|
-
db.tables.instance_variable_set(:@list, Wref::Map.new) # Resets cache
|
65
|
-
|
66
|
-
expect { db.tables[:table] }.to raise_error(Baza::Errors::TableNotFound)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
it "#table_exists #column_exists" do
|
71
|
-
up_down_migration.migrate(:up)
|
72
|
-
test_exists_migration.migrate(:up) # Shouldn't raise anything
|
73
|
-
end
|
74
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe BazaMigrations::MigrationsExecutor do
|
4
|
-
let(:db) do
|
5
|
-
file_path = "#{Dir.tmpdir}/baza_migrations.sqlite3"
|
6
|
-
File.unlink(file_path) if File.exist?(file_path)
|
7
|
-
Baza::Db.new(type: :sqlite3, path: file_path)
|
8
|
-
end
|
9
|
-
|
10
|
-
let(:executor) { BazaMigrations::MigrationsExecutor.new(db: db) }
|
11
|
-
let(:migrations) { executor.instance_variable_get(:@migrations) }
|
12
|
-
|
13
|
-
it "#add_dir" do
|
14
|
-
executor.add_dir("spec/dummy/db/baza_migrate")
|
15
|
-
expect(migrations.length).to eq 2
|
16
|
-
end
|
17
|
-
|
18
|
-
it "#ordered_migrations" do
|
19
|
-
executor.add_dir("spec/dummy/db/baza_migrate")
|
20
|
-
expect(migrations.first.fetch(:time).strftime("%H:%M")).to eq "16:05"
|
21
|
-
expect(migrations[1].fetch(:time).strftime("%H:%M")).to eq "16:18"
|
22
|
-
end
|
23
|
-
|
24
|
-
it "#ensure_schema_migrations_table" do
|
25
|
-
executor.ensure_schema_migrations_table
|
26
|
-
|
27
|
-
table = db.tables[:baza_schema_migrations]
|
28
|
-
expect(table).to_not eq nil
|
29
|
-
end
|
30
|
-
|
31
|
-
it "#execute_migrations" do
|
32
|
-
executor.add_dir("spec/dummy/db/baza_migrate")
|
33
|
-
executor.execute_migrations
|
34
|
-
|
35
|
-
expect(db.select(:baza_schema_migrations, version: "20150901160500").fetch).to_not eq nil
|
36
|
-
expect(db.select(:baza_schema_migrations, version: "20150901161800").fetch).to_not eq nil
|
37
|
-
end
|
38
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require "codeclimate-test-reporter"
|
2
|
-
CodeClimate::TestReporter.start
|
3
|
-
|
4
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
5
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
6
|
-
|
7
|
-
require "rspec"
|
8
|
-
require "baza_migrations"
|
9
|
-
require "tmpdir"
|
10
|
-
|
11
|
-
if RUBY_PLATFORM == "java"
|
12
|
-
require "jdbc/sqlite3"
|
13
|
-
::Jdbc::SQLite3.load_driver
|
14
|
-
else
|
15
|
-
require "sqlite3"
|
16
|
-
end
|
17
|
-
|
18
|
-
# Requires supporting files with custom matchers and macros, etc,
|
19
|
-
# in ./support/ and its subdirectories.
|
20
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
21
|
-
|
22
|
-
RSpec.configure do |config|
|
23
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
class TestChangeMigration < BazaMigrations::Migration
|
2
|
-
def change
|
3
|
-
create_table :table do |t|
|
4
|
-
t.string :name
|
5
|
-
t.integer :age
|
6
|
-
t.timestamps
|
7
|
-
end
|
8
|
-
|
9
|
-
add_column :table, :email, :string
|
10
|
-
add_index :table, :email
|
11
|
-
add_index :table, [:name, :email]
|
12
|
-
end
|
13
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
class TestUpDownMigration < BazaMigrations::Migration
|
2
|
-
def up
|
3
|
-
create_table :test_table do |t|
|
4
|
-
t.string :name
|
5
|
-
t.integer :age
|
6
|
-
t.timestamps
|
7
|
-
end
|
8
|
-
|
9
|
-
add_column :test_table, :email, :string
|
10
|
-
add_index :test_table, :email
|
11
|
-
add_index :test_table, [:name, :email]
|
12
|
-
end
|
13
|
-
|
14
|
-
def down
|
15
|
-
remove_index :test_table, [:name, :email]
|
16
|
-
remove_index :test_table, :email
|
17
|
-
remove_column :test_table, :email
|
18
|
-
drop_table :test_table
|
19
|
-
end
|
20
|
-
end
|
@@ -1,7 +0,0 @@
|
|
1
|
-
class TestExistsMethods < BazaMigrations::Migration
|
2
|
-
def up
|
3
|
-
raise "Table should exist" unless table_exists?(:test_table)
|
4
|
-
raise "Column should exist" unless column_exists?(:test_table, :name)
|
5
|
-
raise "Index should exist" unless index_exists?(:test_table, :email)
|
6
|
-
end
|
7
|
-
end
|