pgsync 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pgsync might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6c20cf99ebc0961d8699228883f6c2e9c95c9798cfb6f101cb78803df6b1b43
4
- data.tar.gz: 7c719442c07e6db1d4704199aa2b95d32e1ba528797b2d21b15be85f2de71d79
3
+ metadata.gz: 6c4a582f7fd5b997ba91247f2b57ad68aae7b5fad282c32dca873d75667922af
4
+ data.tar.gz: a7ae6518b84d28c8ad14786793b8d4257d898214b8071ccc6c91e9d4d144e316
5
5
  SHA512:
6
- metadata.gz: 1e3d735e6e3002e2fcb74de574f63f534472821aca0154c13d9d7ce6e9fa94426239cef875cd33724fec5a6cf2567b5656a80a9d92f89d9678ee6bee2c2ec70c
7
- data.tar.gz: 3ab5d416f4c2364644c015d106631898a3615cc671179f8b1193cda5b1e894512fb39906ec1c27570ca9fbd186c9eb19af3afb88eba093bb21e8bc471c28f18b
6
+ metadata.gz: f008b6d7114e3f11395479de0e85006c5eb48681b13ab613e1468d20a99acf0121566fe5499e236d1e8b07fdd12acc2c3a99399daac3e3e99269efac5e6bd4e5
7
+ data.tar.gz: 536af357b17f35c7afb0e8efba5411a0ecbec67adbfe364d465a8831dd0e56d108055b1ccb55bc0203d92d9a3215a11d3a287f52e89b40b6526534ddfbc8371e
@@ -1,3 +1,7 @@
1
+ ## 0.6.1 (2020-06-07)
2
+
3
+ - Added Django and Laravel integrations
4
+
1
5
  ## 0.6.0 (2020-06-07)
2
6
 
3
7
  - Added messages for different column types and non-deferrable constraints
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 all tables
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
@@ -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
@@ -139,6 +139,7 @@ module PgSync
139
139
  ds
140
140
  end
141
141
 
142
+ # ideally aliases would work, but haven't found a nice way to do this
142
143
  def resolve_source(source)
143
144
  if source
144
145
  source = source.dup
@@ -1,3 +1,3 @@
1
1
  module PgSync
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
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.0
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-07 00:00:00.000000000 Z
11
+ date: 2020-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel