fix-db-schema-conflicts 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_schema.yml +4 -1
- data/README.md +29 -6
- data/fix-db-schema-conflicts.gemspec +1 -1
- data/lib/fix_db_schema_conflicts/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39192bd1c0fb0868396a4760665ce60c2f9e634c
|
4
|
+
data.tar.gz: bbde2547471a0b37a730f5d9518c3b5b0f190905
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5f2a60f67b80eb1c864b0fa56c4bd47c443894f0ae6fd5d3256cc3849532bd1a908dd83177b695ee91360b88342ccfb05dbc328db97d99cff50be053cec93ea
|
7
|
+
data.tar.gz: b4e987375106468b7377f6ab11ccebc1d4592ec06d48e704b7dddab9b998dac88593cf6ea4bfa048d7dac60706e634769c1ed4f64764992c457adb5a9b828cc6
|
data/.rubocop_schema.yml
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,33 @@
|
|
2
2
|
|
3
3
|
It prevents db/schema.rb conflicts in your Rails projects when working with multiple team members.
|
4
4
|
|
5
|
+
Specifically the situation that goes like this:
|
6
|
+
|
7
|
+
John is working on a feature, and adds a migration to create an `updated_at` timestamp to `Task`.
|
8
|
+
Sara is working on a different feature, and adds a migration to create a `name` column to `Task`.
|
9
|
+
They both run their migrations locally, and then get a new copy of master with the other's feature and migration.
|
10
|
+
Then when they run migrations again, John's `tasks` table looks like this:
|
11
|
+
|
12
|
+
t.timestamp :updated_at
|
13
|
+
t.string :name
|
14
|
+
|
15
|
+
And Sara's looks like this:
|
16
|
+
|
17
|
+
t.string :name
|
18
|
+
t.timestamp :updated_at
|
19
|
+
|
20
|
+
And every time they run migrations before committing new code, their `db/schema.rb` file will be showing a change, because they are flipping the order of the columns.
|
21
|
+
|
22
|
+
By using the fix-db-schema-conflicts gem, this problem goes away.
|
23
|
+
|
24
|
+
## How it works
|
25
|
+
|
26
|
+
This gem sorts the table, index, and foreign key names before outputting them to the schema.rb file. Additionally it runs Rubocop with the auto-correct flag to ensure a consistent output format. Then it runs `sed` to cleanup additional horizontal whitespace inserted by Rails.
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
You don't have to do anything different. It should just work. Simply run `rake db:migrate` or `rake db:schema:dump` as you would before and `fix-db-schema-conflicts` will do the rest.
|
31
|
+
|
5
32
|
## Installation
|
6
33
|
|
7
34
|
Add this line to your application's Gemfile in your development group:
|
@@ -14,13 +41,9 @@ And then execute:
|
|
14
41
|
|
15
42
|
$ bundle
|
16
43
|
|
17
|
-
##
|
18
|
-
|
19
|
-
You don't have to do anything different. It should just work. Simply run `rake db:migrate` or `rake db:schema:dump` as you would before and `fix-db-schema-conflicts` will do the rest.
|
44
|
+
## Older versions of Rubocop:
|
20
45
|
|
21
|
-
|
22
|
-
|
23
|
-
This gem sorts the table, index, and foreign key names before outputting them to the schema.rb file. Additionally it runs Rubocop with the auto-correct flag to ensure a consistent output format. Then it runs `sed` to cleanup additional horizontal whitespace inserted by Rails.
|
46
|
+
If you wish to use a version of Rubocop `< 0.36.0` or below, use `gem 'fix-db-schema-conflicts', '~> 1.0.2'`
|
24
47
|
|
25
48
|
## Contributing
|
26
49
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fix-db-schema-conflicts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Moffatt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.36.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.36.0
|
55
55
|
description: Ensures consistent output of db/schema.rb despite local differences in
|
56
56
|
the database
|
57
57
|
email:
|