squasher 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/README.md +9 -5
- data/lib/squasher.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- data/squasher.gemspec +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18fb9959adf3910732c16c6678f2fe13cb43647e
|
4
|
+
data.tar.gz: 3c6c9629ada41354a8c0c2d81263f45893861b3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e20446f165abc6354e04c3311931f4bd65b1c30a6f76563c20dfd819402d53acb1380c4381f3fcff017cfbd21f1f552eba4e180f6319d726c0eb420de44afe11
|
7
|
+
data.tar.gz: afb442cf5dd279dbbdc0c5e8f63b0fc166424aab3d94d9b4b754263d30f98337841240c00a5e328c5faf635881257f5ddb02e395eaf87379d6edd9a36485ee6c
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Squasher
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/jalkoby/squasher.
|
4
|
-
[![Code Climate](https://codeclimate.com/github/jalkoby/squasher.
|
5
|
-
[![Gem Version](https://badge.fury.io/rb/squasher.
|
3
|
+
[![Build Status](https://travis-ci.org/jalkoby/squasher.svg?branch=master)](https://travis-ci.org/jalkoby/squasher)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/jalkoby/squasher.svg)](https://codeclimate.com/github/jalkoby/squasher)
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/squasher.svg)](http://badge.fury.io/rb/squasher)
|
6
6
|
|
7
7
|
Squasher compresses old migrations in a Rails application. If you work on a big project with lots of migrations, every `rake db:migrate` might take a few seconds, or creating of a new database might take a few minutes. That's because Rails loads all those migration files. Squasher removes all the migrations and creates a single migration with the final database state of the specified date (the new migration will look like a schema).
|
8
8
|
|
@@ -12,10 +12,12 @@ You should not add this to your Gemfile. Just standalone installation:
|
|
12
12
|
|
13
13
|
$ gem install squasher
|
14
14
|
|
15
|
-
|
15
|
+
**@note** if you use Rbenv don't forget to run `rbenv rehash`.
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
19
|
+
**@note** stop all preloading systems if there are present (spring, zeus, etc)
|
20
|
+
|
19
21
|
Suppose your application was created a few years ago. `%app_root%/db/migrate` folder looks like this:
|
20
22
|
```bash
|
21
23
|
2009...._first_migration.rb
|
@@ -50,10 +52,12 @@ squasher will not need to create the db schema and all data from the previous mi
|
|
50
52
|
|
51
53
|
## Requirements
|
52
54
|
|
53
|
-
It works and was tested on Ruby 2.0+ and Rails 3.1+. It also requires a valid configuration in `config/database.yml` and using Ruby format in `db/schema.rb` (default Rails use-case).
|
55
|
+
It works and was tested on Ruby 2.0+ and Rails 3.1+. It also requires a valid development configuration in `config/database.yml` and using Ruby format in `db/schema.rb` (default Rails use-case).
|
54
56
|
If an old migration inserted data (created ActiveRecord model records) you will lose this code in the squashed migration, **BUT** `squasher` will ask you to leave a tmp database which will have all data that was inserted while migrating. Using this database you could add that data as another migration, or into `config/seed.rb` (the expected place for this stuff).
|
55
57
|
|
56
58
|
## Changelog
|
59
|
+
- 0.2.1
|
60
|
+
- support rails 5
|
57
61
|
- 0.2.0
|
58
62
|
- add **dry** mode and ability to reuse the previous squasher database
|
59
63
|
- improve database config processing
|
data/lib/squasher.rb
CHANGED
@@ -27,7 +27,7 @@ module Squasher
|
|
27
27
|
|
28
28
|
def rake(command, description = nil)
|
29
29
|
tell(description) if description
|
30
|
-
system("bundle exec rake #{ command }")
|
30
|
+
system("RAILS_ENV=development DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake #{ command }")
|
31
31
|
end
|
32
32
|
|
33
33
|
def ask(*args)
|
data/spec/spec_helper.rb
CHANGED
data/squasher.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "squasher"
|
7
|
-
spec.version = "0.2.
|
7
|
+
spec.version = "0.2.1"
|
8
8
|
spec.authors = ["Sergey Pchelintsev"]
|
9
9
|
spec.email = ["mail@sergeyp.me"]
|
10
10
|
spec.description = %q{Squash your old migrations}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squasher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Pchelintsev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.
|
111
|
+
rubygems_version: 2.5.2
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Squash your old migrations
|
@@ -125,4 +125,3 @@ test_files:
|
|
125
125
|
- spec/lib/squasher_spec.rb
|
126
126
|
- spec/lib/worker_spec.rb
|
127
127
|
- spec/spec_helper.rb
|
128
|
-
has_rdoc:
|