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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +12 -0
- data/lib/sequel_tools/actions/create_db.rb +2 -0
- data/lib/sequel_tools/actions/drop_db.rb +2 -1
- data/lib/sequel_tools/version.rb +1 -1
- 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: 4cedf58b1f6a6ae3c117160b80d67dc480b7e632
|
4
|
+
data.tar.gz: 5475ddb9d818523ae54c1120a2a61e81dfbf778a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ec010df4d9227e688cb0fa27ab02050862cefbf0331111a90237801108e0ce8ac53803bc36c65fe4c23384a5b1af7f216b80689841ca843661ac1b3e214fe58
|
7
|
+
data.tar.gz: 69685b37ca21f1c4fcc54273bb304348e125f773182d6a5eee264b1b7aa3260f54f3ce170ee644ffd770ac2c339ed9ea20ab0dd59e73e93cefb015ba46de108b
|
data/Gemfile.lock
CHANGED
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
|
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
|
data/lib/sequel_tools/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|