seed-snapshot 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c704444bcf7dfebb43e99ce273bc4d75c8593002407defa8cc3ed9b113767c89
4
- data.tar.gz: f02a0ec909ca1da82bd6d0971b512f703bd2df09ba72104900fd413ef7640315
3
+ metadata.gz: 90069e1b7ee4498d79d7ae215173663cc360b0dda9ac7df7e4413e0faa177fc0
4
+ data.tar.gz: 632a91e5023b4c76fb35c8f04d0667d7569572283b589f04c1ce333c296535d9
5
5
  SHA512:
6
- metadata.gz: cfc9b0201540a7bdbad254a72159e3b4852335bc762a5f348d47e79ae233159cf7133af9499f0e7c4343796f713ca7d0202516d8e72c928d7ac40f989621ad17
7
- data.tar.gz: 117aa3b725b47e77fe13e89d226c57e23b2780f952c69e2f0e657d767eb4348e7437b39e1f62712f63f261e354ee81ee0ecd06ffcf5e916abee78c64db738eab
6
+ metadata.gz: a02a6935e5df0947f2af651630ddb4bf9398e30dc9fba0a8386d1898109f71f67fd06ec7c6ae7bdc2ff11cf41c2c4e8c041efe1650248ddc7e4f00fcc1d8d941
7
+ data.tar.gz: f6f95d24fcec890787caa28fd255638fba2845508d0865ffcea9e0ca09335adea65abfe9d36b92016a3073b73d0dbb50ce43b3220ad3790020b17decbfc0d4c9
@@ -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'
@@ -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.6.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,14 @@
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.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yo_waka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-12 00:00:00.000000000 Z
11
+ date: 2024-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
19
+ version: '7.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4.2'
26
+ version: '7.0'
27
27
  description: Easy dump/restore tool for ActiveRecord.
28
28
  email:
29
29
  - y.wakahara@gmail.com
@@ -39,7 +39,10 @@ files:
39
39
  - Rakefile
40
40
  - bin/console
41
41
  - bin/setup
42
- - gemfiles/ar_6_1.gemfile
42
+ - gemfiles/ar_7.0.gemfile
43
+ - gemfiles/ar_7.1.gemfile
44
+ - gemfiles/ar_7.2.gemfile
45
+ - gemfiles/ar_8.0.gemfile
43
46
  - lib/seed-snapshot.rb
44
47
  - lib/seed/configuration.rb
45
48
  - lib/seed/manifest.rb
@@ -67,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
70
  - !ruby/object:Gem::Version
68
71
  version: '0'
69
72
  requirements: []
70
- rubygems_version: 3.4.10
73
+ rubygems_version: 3.5.9
71
74
  signing_key:
72
75
  specification_version: 4
73
76
  summary: Easy dump/restore tool for ActiveRecord.