git-fit 0.5.5 → 0.5.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5199ac476679804fa42f2a471db2d34c8d3d2d6a0e03b32a14dcc0683a32d36
4
- data.tar.gz: bf224337a9e33a245e30039a0415f94997a9c5cf097dc2aab2c66687522eff74
3
+ metadata.gz: 7089f5239cfdfa84e26c2d7b6d5cf1b752f058e39c9133d448882b85a71d26eb
4
+ data.tar.gz: c09e5c2c468f4e33623c90e90409130f184a908e93cd601480795c4625f31b44
5
5
  SHA512:
6
- metadata.gz: c0791cb45a66de48588995fb66f1a8c9ceaaf8eb84fa7c1fa60051d10f9e81dc0e1091fe710078821438ae744484b9913f249871f96380f7733a0a4782e776ac
7
- data.tar.gz: 48a836e541ea4c5c297a45d7ea592adda6bc8b3a39054e8d82ee65ea1ba275d6b36675a25a2d86f96e157c10767b250adfa83b69cb5fb017c0bf91f5219d2a10
6
+ metadata.gz: 34e7549e0d4cf4b91f87c73c769e54f3759a7ce9029b9de271d324b1936eefdaa20f38c3a7dd4fd42aef180df7dbaf0d037172a8e9dbbf29ccb19fdb15db8ef4
7
+ data.tar.gz: bb3e13a18df0f9db94888d8dbc590c50eb778dbdf00cd3ac4a9f6b888185966c3b0d204ded94cd46271c27f8da1733adb74ce433929b6262c6fcbfaae29fdf0f
@@ -11,6 +11,23 @@ module GitFit
11
11
  rescue => e
12
12
  say_status :error, "Migration failed: #{e.message}", :red
13
13
  end
14
+
15
+ desc "schema", "Print DB schema DDL derived from migrations"
16
+ option :hash, type: :boolean, desc: "Print sha256 hexdigest instead of DDL"
17
+ def schema
18
+ require "digest"
19
+ db = Sequel.sqlite
20
+ Sequel.extension :migration
21
+ dir = File.expand_path("../../../db/migrations", __dir__)
22
+ Sequel::Migrator.run(db, dir)
23
+ ddl = db.fetch("SELECT sql FROM sqlite_master WHERE sql IS NOT NULL ORDER BY name")
24
+ .map(:sql).join("\n") + "\n"
25
+ if options[:hash]
26
+ puts Digest::SHA256.hexdigest(ddl)
27
+ else
28
+ print ddl
29
+ end
30
+ end
14
31
  end
15
32
  end
16
33
  end
@@ -1,3 +1,3 @@
1
1
  module GitFit
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-fit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lax