rack-app-sequel 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rack/app/sequel/migration/cli.rb +10 -2
- 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: bd00123af00c6e2fdcf4d50c826d8a526eb14dd6
|
4
|
+
data.tar.gz: 4d051b528a10285bc32665c28b5b974a54c6c2f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9987c2c2b3622d5b004f7a7279d038f901eda502727e5f403608de94ae184f08e55d5df520073d718aeb8ded52694c9bcc6b7a5b07c9fe998787351c66aa8c79
|
7
|
+
data.tar.gz: bf63f57b9ab0430adde9982169d16855bdea8e7b971863887a0cd9c269b81343a4e7f1d46af5fa3b90bf3a4dca292db27ff9e5fbcb9c541e046e5e5905bf46e1
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -15,6 +15,10 @@ Rack::App::SeQueL::Migration::CLI = lambda do
|
|
15
15
|
options[:migration_directory] = string
|
16
16
|
end
|
17
17
|
|
18
|
+
option '--verbose', 'set migration to be verbose instead of silent' do
|
19
|
+
options[:verbose] = true
|
20
|
+
end
|
21
|
+
|
18
22
|
action do
|
19
23
|
|
20
24
|
options[:migration_directory] ||= Rack::App::SeQueL::Migration::DEFAULT_DIRECTORY
|
@@ -23,19 +27,23 @@ Rack::App::SeQueL::Migration::CLI = lambda do
|
|
23
27
|
db = Rack::App::SeQueL.open_connection
|
24
28
|
db = Sequel.connect(ENV.fetch('DATABASE_URL'))
|
25
29
|
|
30
|
+
logger = Logger.new(options[:verbose] ? ::STDOUT : ::IO::NULL)
|
31
|
+
db.loggers << logger
|
32
|
+
|
26
33
|
migration_config = {}
|
27
34
|
if options[:allow_missing_migration_files]
|
28
35
|
migration_config[:allow_missing_migration_files]= true
|
29
36
|
end
|
30
37
|
|
31
38
|
if options[:version]
|
32
|
-
|
39
|
+
logger.info("Migrating to version #{options[:version]}")
|
40
|
+
|
33
41
|
migration_config[:target]= options[:version].to_i
|
34
42
|
end
|
35
43
|
|
36
44
|
Sequel::Migrator.run(db, options[:migration_directory], migration_config)
|
37
45
|
|
38
|
-
|
46
|
+
logger.info('Migration completed')
|
39
47
|
end
|
40
48
|
|
41
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-app-sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|