pgsync 0.6.0 → 0.6.1
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +44 -1
- data/lib/pgsync/init.rb +20 -1
- data/lib/pgsync/sync.rb +1 -0
- data/lib/pgsync/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6c4a582f7fd5b997ba91247f2b57ad68aae7b5fad282c32dca873d75667922af
|
|
4
|
+
data.tar.gz: a7ae6518b84d28c8ad14786793b8d4257d898214b8071ccc6c91e9d4d144e316
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f008b6d7114e3f11395479de0e85006c5eb48681b13ab613e1468d20a99acf0121566fe5499e236d1e8b07fdd12acc2c3a99399daac3e3e99269efac5e6bd4e5
|
|
7
|
+
data.tar.gz: 536af357b17f35c7afb0e8efba5411a0ecbec67adbfe364d465a8831dd0e56d108055b1ccb55bc0203d92d9a3215a11d3a287f52e89b40b6526534ddfbc8371e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -35,7 +35,7 @@ This creates `.pgsync.yml` for you to customize. We recommend checking this into
|
|
|
35
35
|
|
|
36
36
|
First, make sure your schema is set up in both databases. We recommend using a schema migration tool for this, but pgsync also provides a few [convenience methods](#schema). Once that’s done, you’re ready to sync data.
|
|
37
37
|
|
|
38
|
-
Sync
|
|
38
|
+
Sync tables
|
|
39
39
|
|
|
40
40
|
```sh
|
|
41
41
|
pgsync
|
|
@@ -262,6 +262,49 @@ This creates `.pgsync-db2.yml` for you to edit. Specify a database in commands w
|
|
|
262
262
|
pgsync --db db2
|
|
263
263
|
```
|
|
264
264
|
|
|
265
|
+
## Integrations
|
|
266
|
+
|
|
267
|
+
- [Django](#django)
|
|
268
|
+
- [Heroku](#heroku)
|
|
269
|
+
- [Laravel](#laravel)
|
|
270
|
+
- [Rails](#rails)
|
|
271
|
+
|
|
272
|
+
### Django
|
|
273
|
+
|
|
274
|
+
If you run `pgsync --init` in a Django project, migrations will be excluded in `.pgsync.yml`.
|
|
275
|
+
|
|
276
|
+
```yml
|
|
277
|
+
exclude:
|
|
278
|
+
- django_migrations
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Heroku
|
|
282
|
+
|
|
283
|
+
If you run `pgsync --init` in a Heroku project, the `from` database will be set in `.pgsync.yml`.
|
|
284
|
+
|
|
285
|
+
```yml
|
|
286
|
+
from: $(heroku config:get DATABASE_URL)?sslmode=require
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Laravel
|
|
290
|
+
|
|
291
|
+
If you run `pgsync --init` in a Laravel project, migrations will be excluded in `.pgsync.yml`.
|
|
292
|
+
|
|
293
|
+
```yml
|
|
294
|
+
exclude:
|
|
295
|
+
- migrations
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Rails
|
|
299
|
+
|
|
300
|
+
If you run `pgsync --init` in a Rails project, Active Record metadata and schema migrations will be excluded in `.pgsync.yml`.
|
|
301
|
+
|
|
302
|
+
```yml
|
|
303
|
+
exclude:
|
|
304
|
+
- ar_internal_metadata
|
|
305
|
+
- schema_migrations
|
|
306
|
+
```
|
|
307
|
+
|
|
265
308
|
## Other Commands
|
|
266
309
|
|
|
267
310
|
Help
|
data/lib/pgsync/init.rb
CHANGED
|
@@ -30,8 +30,19 @@ module PgSync
|
|
|
30
30
|
if rails?
|
|
31
31
|
<<~EOS
|
|
32
32
|
exclude:
|
|
33
|
-
- schema_migrations
|
|
34
33
|
- ar_internal_metadata
|
|
34
|
+
- schema_migrations
|
|
35
|
+
EOS
|
|
36
|
+
elsif django?
|
|
37
|
+
# TODO exclude other tables?
|
|
38
|
+
<<~EOS
|
|
39
|
+
exclude:
|
|
40
|
+
- django_migrations
|
|
41
|
+
EOS
|
|
42
|
+
elsif laravel?
|
|
43
|
+
<<~EOS
|
|
44
|
+
exclude:
|
|
45
|
+
- migrations
|
|
35
46
|
EOS
|
|
36
47
|
else
|
|
37
48
|
<<~EOS
|
|
@@ -50,10 +61,18 @@ module PgSync
|
|
|
50
61
|
end
|
|
51
62
|
end
|
|
52
63
|
|
|
64
|
+
def django?
|
|
65
|
+
(File.read("manage.py") =~ /django/i) rescue false
|
|
66
|
+
end
|
|
67
|
+
|
|
53
68
|
def heroku?
|
|
54
69
|
`git remote -v 2>&1`.include?("git.heroku.com") rescue false
|
|
55
70
|
end
|
|
56
71
|
|
|
72
|
+
def laravel?
|
|
73
|
+
File.exist?("artisan")
|
|
74
|
+
end
|
|
75
|
+
|
|
57
76
|
def rails?
|
|
58
77
|
File.exist?("bin/rails")
|
|
59
78
|
end
|
data/lib/pgsync/sync.rb
CHANGED
data/lib/pgsync/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pgsync
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Kane
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-06-
|
|
11
|
+
date: 2020-06-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: parallel
|