fix-db-schema-conflicts 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +7 -7
- data/lib/fix_db_schema_conflicts/schema_dumper.rb +2 -0
- data/lib/fix_db_schema_conflicts/version.rb +1 -1
- data/lib/tasks/db.rake +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cf377dd87148b7e42c99528125d9afefd6789a5
|
4
|
+
data.tar.gz: 70e527ce5f16ad2c910cda092c9226415e56a071
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd3738491c717b952c75fc9f635b8b110d5e45ae2acf4216381707145c8af5c58c71470affc29fac2df901c4cd1348f18b0db1351fbdf98fa94cfa7cfdf31814
|
7
|
+
data.tar.gz: 76bc1f6ea737e97ab0bd57308f96106492d8de667f6051eed463a002633a2436c258b65905b976a5a1187d861973301fdfe36f4c19d79bb12a526260139840e3
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
#
|
1
|
+
# fix-db-schema-conflicts
|
2
2
|
|
3
|
-
|
3
|
+
It prevents db/schema.rb conflicts in your Rails projects when working with multiple team members.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
Add this line to your application's Gemfile:
|
7
|
+
Add this line to your application's Gemfile in your development group:
|
8
8
|
|
9
9
|
```ruby
|
10
10
|
gem 'fix-db-schema-conflicts'
|
@@ -14,13 +14,13 @@ And then execute:
|
|
14
14
|
|
15
15
|
$ bundle
|
16
16
|
|
17
|
-
|
17
|
+
## Usage
|
18
18
|
|
19
|
-
|
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.
|
20
20
|
|
21
|
-
##
|
21
|
+
## How it works
|
22
22
|
|
23
|
-
|
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.
|
24
24
|
|
25
25
|
## Contributing
|
26
26
|
|
data/lib/tasks/db.rake
CHANGED
@@ -2,7 +2,11 @@ namespace :db do
|
|
2
2
|
namespace :schema do
|
3
3
|
task :dump do
|
4
4
|
puts "Dumping database schema with fix-db-schema-conflicts gem"
|
5
|
-
filename = ENV['SCHEMA'] ||
|
5
|
+
filename = ENV['SCHEMA'] || if defined? ActiveRecord::Tasks::DatabaseTasks
|
6
|
+
File.join(ActiveRecord::Tasks::DatabaseTasks.db_dir, 'schema.rb')
|
7
|
+
else
|
8
|
+
"#{Rails.root}/db/schema.rb"
|
9
|
+
end
|
6
10
|
rubocop_yml = File.expand_path('../../../.rubocop_schema.yml', __FILE__)
|
7
11
|
`rubocop --auto-correct --config #{rubocop_yml} #{filename}`
|
8
12
|
`sed -E -e 's/, +/, /g' #{filename} > db/schema.fixed.rb`
|
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.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Moffatt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11
|
11
|
+
date: 2014-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|