sequel_tools 0.1.7 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rvmrc +2 -0
- data/.travis.yml +2 -2
- data/README.md +1 -1
- data/lib/sequel_tools/actions/migrate.rb +1 -0
- data/lib/sequel_tools/actions/schema_dump_postgres.rb +6 -2
- data/lib/sequel_tools/migration_utils.rb +1 -0
- data/lib/sequel_tools/version.rb +1 -1
- data/lib/sequel_tools.rb +1 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c0f41214aa234b695fe944213041c60cb60dd6a423a9f07c1af3d6b48988e26
|
4
|
+
data.tar.gz: 033cfa1e62d8f4ce84d7c574a054362b8e2c77d644d1f8781e689f5592e4f0cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44d591780ed7f2e86fdc7e2fca11ec3b1f93ef2c604aa8558379f37e311c04e665d1047d53e290d2f0fd5fe426ab7bed3aeb48eb0c054d79b6e04532ffb9ad10
|
7
|
+
data.tar.gz: b18af3bb7a7985ff33f175229e9f1aab1195f31adf5a5aa08a6bddd84a0c30623bcf59f5c54d33a6d9e14af8c87c5428d4cf13f2eb8b75f2e86881544f0e6e82
|
data/.rvmrc
ADDED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -131,7 +131,7 @@ approve your pull requests and you'd be able to maintain it independently.
|
|
131
131
|
## Development and running tests
|
132
132
|
|
133
133
|
The tests assume the database `sequel_tools_test_pw` exists and can be only accessed using a
|
134
|
-
username and password. It also assumes a valid user/passwd is `
|
134
|
+
username and password. It also assumes a valid user/passwd is `sequel_tools_user/secret`. The
|
135
135
|
database `sequel_tools_test` is also required to exist and it should be possible to access it
|
136
136
|
using the `trust` authentication method, without requiring a password. You may achieve that by
|
137
137
|
adding these lines to the start of your `pg_hba.conf`:
|
@@ -12,6 +12,7 @@ class SequelTools::ActionsManager
|
|
12
12
|
Sequel.extension :migration unless Sequel.respond_to? :migration
|
13
13
|
options = {}
|
14
14
|
options[:target] = args[:version].to_i if args[:version]
|
15
|
+
options[:table] = config[:migrations_table] if config[:migrations_table]
|
15
16
|
Sequel::Migrator.run db, config[:migrations_location], options
|
16
17
|
Action[:schema_dump].run({}, context) if config[:dump_schema_on_migrate]
|
17
18
|
end
|
@@ -12,9 +12,13 @@ class SequelTools::ActionsManager
|
|
12
12
|
stdout, stderr, success = PgHelper.run_pg_command c, "#{pg_dump} -s"
|
13
13
|
return unless success
|
14
14
|
content = stdout
|
15
|
-
|
15
|
+
migrations_table = c[:migrations_table]
|
16
|
+
if (migrations_table ? content.include?(migrations_table) :
|
17
|
+
(content =~ /schema_(migrations|info)/))
|
18
|
+
table_options = migrations_table ? "-t #{migrations_table}" :
|
19
|
+
'-t schema_migrations -t schema_info'
|
16
20
|
stdout, stderr, success =
|
17
|
-
PgHelper.run_pg_command c, "#{pg_dump} -a
|
21
|
+
PgHelper.run_pg_command c, "#{pg_dump} -a #{table_options} --inserts"
|
18
22
|
unless success
|
19
23
|
puts 'failed to dump data for schema_migrations and schema_info. Aborting.'
|
20
24
|
exit 1
|
@@ -22,6 +22,7 @@ class MigrationUtils
|
|
22
22
|
options = { allow_missing_migration_files: true }
|
23
23
|
options[:target] = 0 if direction == :down
|
24
24
|
config = context[:config]
|
25
|
+
options[:table] = config[:migrations_table] if config[:migrations_table]
|
25
26
|
Sequel::Migrator.migrator_class(config[:migrations_location]).
|
26
27
|
new(context[:db], config[:migrations_location], options)
|
27
28
|
end
|
data/lib/sequel_tools/version.rb
CHANGED
data/lib/sequel_tools.rb
CHANGED
@@ -20,6 +20,7 @@ module SequelTools
|
|
20
20
|
dump_schema_on_migrate: false,
|
21
21
|
log_level: nil,
|
22
22
|
sql_log_level: :debug,
|
23
|
+
migrations_table: nil,
|
23
24
|
} # unfrozen on purpose so that one might want to update the defaults
|
24
25
|
|
25
26
|
REQUIRED_KEYS = [ :project_root, :dbadapter, :dbname, :username ]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Rosenfeld Rosas
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|
@@ -97,6 +97,7 @@ extra_rdoc_files: []
|
|
97
97
|
files:
|
98
98
|
- ".gitignore"
|
99
99
|
- ".rspec"
|
100
|
+
- ".rvmrc"
|
100
101
|
- ".travis.yml"
|
101
102
|
- Gemfile
|
102
103
|
- LICENSE.txt
|
@@ -139,7 +140,7 @@ homepage: https://github.com/rosenfeld/sequel_tools
|
|
139
140
|
licenses:
|
140
141
|
- MIT
|
141
142
|
metadata: {}
|
142
|
-
post_install_message:
|
143
|
+
post_install_message:
|
143
144
|
rdoc_options: []
|
144
145
|
require_paths:
|
145
146
|
- lib
|
@@ -154,9 +155,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
155
|
- !ruby/object:Gem::Version
|
155
156
|
version: '0'
|
156
157
|
requirements: []
|
157
|
-
|
158
|
-
|
159
|
-
signing_key:
|
158
|
+
rubygems_version: 3.3.7
|
159
|
+
signing_key:
|
160
160
|
specification_version: 4
|
161
161
|
summary: Add Rake tasks to manage Sequel migrations
|
162
162
|
test_files: []
|