seed-snapshot 0.5.3 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c704444bcf7dfebb43e99ce273bc4d75c8593002407defa8cc3ed9b113767c89
4
- data.tar.gz: f02a0ec909ca1da82bd6d0971b512f703bd2df09ba72104900fd413ef7640315
3
+ metadata.gz: 7ef5c34c4578ce762ac87e59b187d72c3688f90f51b075e553e11be7ec6b397a
4
+ data.tar.gz: 53bf8fc36fbf5b2db69f07889b8bd2bcab27282bc4b7b8730af5ad2a43c53640
5
5
  SHA512:
6
- metadata.gz: cfc9b0201540a7bdbad254a72159e3b4852335bc762a5f348d47e79ae233159cf7133af9499f0e7c4343796f713ca7d0202516d8e72c928d7ac40f989621ad17
7
- data.tar.gz: 117aa3b725b47e77fe13e89d226c57e23b2780f952c69e2f0e657d767eb4348e7437b39e1f62712f63f261e354ee81ee0ecd06ffcf5e916abee78c64db738eab
6
+ metadata.gz: 57ec41c9b0c18d2834cd499743cd15de93e2e0c68ccb8ce0cb0b16adbf9ef2fbb0bdcc78f7d1571106de6eff5f05b148b36a74065faf1e57ec39a5ca116daa3d
7
+ data.tar.gz: 912325ee93075b5f0aad64c2656edab3b720fe6278cd68c566730b69b75af46695b318e97db9b65490f093bb34614d9fce239b03bddc598968f4b080f4b2dfd2
@@ -16,6 +16,8 @@ jobs:
16
16
  build:
17
17
  runs-on: ubuntu-latest
18
18
 
19
+ name: test (ruby:${{ matrix.ruby }}, ar:${{ matrix.ar }})
20
+
19
21
  services:
20
22
  mysql:
21
23
  image: mysql:8.0
@@ -27,27 +29,26 @@ jobs:
27
29
  options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10
28
30
 
29
31
  strategy:
32
+ fail-fast: false
30
33
  matrix:
31
- ruby-version: ['3.0', '3.1']
32
- gemfile: ['Gemfile', 'gemfiles/ar_6_1.gemfile']
34
+ ruby: ['3.1', '3.2', '3.3']
35
+ ar: ['7.0', '7.1', '7.2', '8.0']
36
+ exclude:
37
+ - ruby: '3.1'
38
+ ar: '8.0'
33
39
 
34
40
  env:
35
- BUNDLE_GEMFILE: ${{ matrix.gemfile }}
41
+ BUNDLE_GEMFILE: gemfiles/ar_${{ matrix.ar }}.gemfile
36
42
 
37
43
  steps:
38
- - name: Checkout
39
- uses: actions/checkout@v3
40
-
41
- - name: Set up Ruby ${{ matrix.ruby-version }}
42
- uses: ruby/setup-ruby@v1
43
- with:
44
- ruby-version: ${{ matrix.ruby-version }}
45
- bundler-cache: true
46
-
47
- - name: Install dependencies
48
- run: |
49
- gem install bundler
50
- bundle install --jobs 3 --retry 3
51
-
52
- - name: Run tests
53
- run: bundle exec rake
44
+ - name: Checkout
45
+ uses: actions/checkout@v4
46
+
47
+ - name: Set up Ruby ${{ matrix.ruby }}
48
+ uses: ruby/setup-ruby@v1
49
+ with:
50
+ ruby-version: ${{ matrix.ruby }}
51
+ bundler-cache: true
52
+
53
+ - name: Run tests
54
+ run: bundle exec rake
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # SeedSnapshot
1
+ # seed-snapshot
2
2
 
3
- [![Build Status](https://travis-ci.org/waka/seed-snapshot.png?branch=master)](https://travis-ci.org/waka/seed-snapshot)
4
-
5
- This library manage of dump/restore data by database.
3
+ The library that easily and quickly dumps and restores seed data.
6
4
 
7
5
  ## Installation
8
6
 
@@ -6,4 +6,4 @@ gem 'pry'
6
6
  gem 'minitest'
7
7
  gem 'erubis'
8
8
  gem 'mysql2', '>= 0.4.4', '< 0.6.0'
9
- gem 'activerecord', '~> 6.1.0'
9
+ gem 'activerecord', '~> 7.0.0'
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'bundler'
4
+ gem 'rake'
5
+ gem 'pry'
6
+ gem 'minitest'
7
+ gem 'erubis'
8
+ gem 'mysql2', '>= 0.4.4', '< 0.6.0'
9
+ gem 'activerecord', '~> 7.1.0'
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'bundler'
4
+ gem 'rake'
5
+ gem 'pry'
6
+ gem 'minitest'
7
+ gem 'erubis'
8
+ gem 'mysql2', '>= 0.4.4', '< 0.6.0'
9
+ gem 'activerecord', '~> 7.2.0'
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'bundler'
4
+ gem 'rake'
5
+ gem 'pry'
6
+ gem 'minitest'
7
+ gem 'erubis'
8
+ gem 'mysql2', '>= 0.4.4', '< 0.6.0'
9
+ gem 'activerecord', '~> 8.0.0'
@@ -21,7 +21,7 @@ module Seed
21
21
  end
22
22
 
23
23
  def database_options
24
- @options ||= ActiveRecord::Base.connection.raw_connection.query_options
24
+ @options ||= ActiveRecord::Base.connection_db_config.configuration_hash
25
25
  end
26
26
 
27
27
  # ${Rails.root}/tmp/dump
@@ -41,7 +41,10 @@ module Seed
41
41
  private
42
42
 
43
43
  def get_all_versions
44
- if ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new('6.0')
44
+ if ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new('7.1')
45
+ migration_paths = ::ActiveRecord::Migrator.migrations_paths
46
+ ::ActiveRecord::MigrationContext.new(migration_paths).get_all_versions
47
+ elsif ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new('6.0')
45
48
  migration_paths = ::ActiveRecord::Migrator.migrations_paths
46
49
  ::ActiveRecord::MigrationContext.new(migration_paths, ::ActiveRecord::SchemaMigration).get_all_versions
47
50
  elsif ::Gem::Version.new(::ActiveRecord::VERSION::STRING) >= ::Gem::Version.new('5.2')
data/lib/seed/snapshot.rb CHANGED
@@ -68,11 +68,16 @@ module Seed
68
68
  end
69
69
  end
70
70
 
71
+ IGNORED_TABLES = [
72
+ 'ar_internal_metadata',
73
+ 'schema_migrations'
74
+ ].freeze
75
+
71
76
  def ignore_tables(classes)
72
77
  db = @configuration.database_options[:database]
73
78
 
74
79
  # mysqldump `--ignore-table` options require database name.
75
- tables(classes).push('schema_migrations').map {|t| "#{db}.#{t}" }
80
+ tables(classes).concat(IGNORED_TABLES).map {|t| "#{db}.#{t}" }
76
81
  end
77
82
  end
78
83
  end
@@ -1,3 +1,3 @@
1
1
  module SeedSnapshot
2
- VERSION = "0.5.3"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -17,5 +17,5 @@ Gem::Specification.new do |spec|
17
17
  spec.require_paths = ['lib']
18
18
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
19
 
20
- spec.add_runtime_dependency 'activerecord', '>= 4.2'
20
+ spec.add_runtime_dependency 'activerecord', '>= 7.0'
21
21
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seed-snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yo_waka
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-12 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '4.2'
18
+ version: '7.0'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: '4.2'
25
+ version: '7.0'
27
26
  description: Easy dump/restore tool for ActiveRecord.
28
27
  email:
29
28
  - y.wakahara@gmail.com
@@ -39,7 +38,10 @@ files:
39
38
  - Rakefile
40
39
  - bin/console
41
40
  - bin/setup
42
- - gemfiles/ar_6_1.gemfile
41
+ - gemfiles/ar_7.0.gemfile
42
+ - gemfiles/ar_7.1.gemfile
43
+ - gemfiles/ar_7.2.gemfile
44
+ - gemfiles/ar_8.0.gemfile
43
45
  - lib/seed-snapshot.rb
44
46
  - lib/seed/configuration.rb
45
47
  - lib/seed/manifest.rb
@@ -52,7 +54,6 @@ homepage: https://github.com/waka/seed-snapshot
52
54
  licenses:
53
55
  - MIT
54
56
  metadata: {}
55
- post_install_message:
56
57
  rdoc_options: []
57
58
  require_paths:
58
59
  - lib
@@ -67,8 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
68
  - !ruby/object:Gem::Version
68
69
  version: '0'
69
70
  requirements: []
70
- rubygems_version: 3.4.10
71
- signing_key:
71
+ rubygems_version: 3.6.8
72
72
  specification_version: 4
73
73
  summary: Easy dump/restore tool for ActiveRecord.
74
74
  test_files: []