sequel_tools 0.1.9 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/sequel_tools/actions/schema_dump_postgres.rb +9 -2
- data/lib/sequel_tools/migration_utils.rb +2 -1
- data/lib/sequel_tools/version.rb +1 -1
- data/lib/sequel_tools.rb +1 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3668a069d02fe15d3bb54d054ad64dd0eab240ba4f6e65023aa8a6f92b3008cf
|
4
|
+
data.tar.gz: '019eefc9bf0565c54126fd54670da7623094a133dcddf34cbcaf75498f282c9e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf9dcaa9cea96bbcec7afaf439e9b32d95baa36181769dd0a954e9a7da25a4f04594483757aedea620bd1fd2899e83d4553682c3e6e193e7463dc26615db03af
|
7
|
+
data.tar.gz: ef6078623ab39f8d58f78c1f836b08081b4c4ab1b94981cf9fea6d3a47efb7d1c887af77d381e55c9c79f8d9f9dcf695c401eec1a14906612f57b15a04c84885
|
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,9 +12,16 @@ 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
|
+
include_tables = migrations_table ? [migrations_table] :
|
19
|
+
['schema_migrations', 'schema_info']
|
20
|
+
extra_tables = c[:extra_tables_in_dump]
|
21
|
+
include_tables.concat extra_tables if extra_tables
|
22
|
+
table_options = include_tables.map{|t| "-t #{t}"}.join(' ')
|
16
23
|
stdout, stderr, success =
|
17
|
-
PgHelper.run_pg_command c, "#{pg_dump} -a
|
24
|
+
PgHelper.run_pg_command c, "#{pg_dump} -a #{table_options} --inserts"
|
18
25
|
unless success
|
19
26
|
puts 'failed to dump data for schema_migrations and schema_info. Aborting.'
|
20
27
|
exit 1
|
@@ -43,7 +43,8 @@ class MigrationUtils
|
|
43
43
|
def self.migrations_differences(context)
|
44
44
|
config = context[:config]
|
45
45
|
migrations_path = config[:migrations_location]
|
46
|
-
existing = Dir["#{migrations_path}/*.rb"].map{|fn| File.basename
|
46
|
+
existing = Dir["#{migrations_path}/*.rb"].map{|fn| File.basename(fn).downcase }.sort
|
47
|
+
existing.delete(File.basename(config[:seeds_location])&.downcase)
|
47
48
|
migrator = find_migrator context
|
48
49
|
migrated = migrator.ds.select_order_map(migrator.column)
|
49
50
|
unapplied = existing - migrated
|
data/lib/sequel_tools/version.rb
CHANGED
data/lib/sequel_tools.rb
CHANGED
@@ -21,6 +21,7 @@ module SequelTools
|
|
21
21
|
log_level: nil,
|
22
22
|
sql_log_level: :debug,
|
23
23
|
migrations_table: nil,
|
24
|
+
extra_tables_in_dump: nil,
|
24
25
|
} # unfrozen on purpose so that one might want to update the defaults
|
25
26
|
|
26
27
|
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.12
|
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
|
@@ -140,7 +140,7 @@ homepage: https://github.com/rosenfeld/sequel_tools
|
|
140
140
|
licenses:
|
141
141
|
- MIT
|
142
142
|
metadata: {}
|
143
|
-
post_install_message:
|
143
|
+
post_install_message:
|
144
144
|
rdoc_options: []
|
145
145
|
require_paths:
|
146
146
|
- lib
|
@@ -155,8 +155,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: '0'
|
157
157
|
requirements: []
|
158
|
-
rubygems_version: 3.
|
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: []
|