sequel_tools 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d0e18541b0c10f5eb8a0a2fa329c72fd49f1435
4
- data.tar.gz: c4ee1602be22e186639dc5a4da230e03b47fe2bd
3
+ metadata.gz: 4cedf58b1f6a6ae3c117160b80d67dc480b7e632
4
+ data.tar.gz: 5475ddb9d818523ae54c1120a2a61e81dfbf778a
5
5
  SHA512:
6
- metadata.gz: d011efe822f2399cbbb8ab529e11c4abb8dca9f05d902a3345df2948d261aac202fd429ce51a5b9ef0d8b32dd492dc5087b75eec7a9aa1f6c8c2fb3c6b3040d7
7
- data.tar.gz: 700afa1a00a72e71dce979d25fd192165b242c5e408d2725640afdd0cbab5d9e5b6dacbdb86882501349e2e9801725ae8dbab78a7017583a7fb20fbaa3439125
6
+ metadata.gz: 8ec010df4d9227e688cb0fa27ab02050862cefbf0331111a90237801108e0ce8ac53803bc36c65fe4c23384a5b1af7f216b80689841ca843661ac1b3e214fe58
7
+ data.tar.gz: 69685b37ca21f1c4fcc54273bb304348e125f773182d6a5eee264b1b7aa3260f54f3ce170ee644ffd770ac2c339ed9ea20ab0dd59e73e93cefb015ba46de108b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sequel_tools (0.1.1)
4
+ sequel_tools (0.1.2)
5
5
  sequel
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -41,6 +41,18 @@ base_config = SequelTools.base_config(
41
41
  dbname: 'mydb',
42
42
  username: 'myuser',
43
43
  password: 'secret',
44
+ # default log_level is nil, in which mode the executed actions such as
45
+ # starting/finishing a migration in a given direction or creating and
46
+ # dropping the database are not logged to standard output.
47
+ log_level: :info,
48
+
49
+ # Default options:
50
+ sql_log_level: :debug,
51
+ dump_schema_on_migrate: false, # it's a good idea to enable it for the reference environment
52
+ pg_dump: 'pg_dump', # command used to run pg_dump
53
+ db_migrations_location: 'db/migrations',
54
+ schema_location: 'db/migrations/schema.sql',
55
+ seeds_location: 'db/seeds.rb',
44
56
  maintenancedb: 'postgres' # for tasks such as creating the database
45
57
  )
46
58
 
@@ -12,6 +12,8 @@ class SequelTools::ActionsManager
12
12
  db = Sequel.connect context[:uri_builder].call(c, c[:maintenancedb])
13
13
  db << "create database #{c[:dbname]}"
14
14
  db.disconnect
15
+ Action[:connect_db].run({}, context)
16
+ context[:db].log_info "Created database '#{c[:dbname]}'"
15
17
  else
16
18
  puts 'Database already exists - aborting'
17
19
  exit 1
@@ -11,11 +11,12 @@ class SequelTools::ActionsManager
11
11
  puts 'Database does not exist - aborting.'
12
12
  exit 1
13
13
  else
14
- context.delete(:db).disconnect
14
+ (old_db = context.delete :db).disconnect
15
15
  c = context[:config]
16
16
  db = Sequel.connect context[:uri_builder].call(c, c[:maintenancedb])
17
17
  db << "drop database #{c[:dbname]}"
18
18
  db.disconnect
19
+ old_db.log_info "Dropped database '#{c[:dbname]}'"
19
20
  end
20
21
  end
21
22
  end
@@ -1,5 +1,5 @@
1
1
  # frozen-string-literal: true
2
2
 
3
3
  module SequelTools
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Rosenfeld Rosas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-15 00:00:00.000000000 Z
11
+ date: 2017-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel