blue-shift 0.0.6 → 0.1.0
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 +4 -4
- data/lib/blueshift/version.rb +1 -1
- data/lib/sequel/adapters/postgres_ext.rb +0 -1
- data/lib/tasks/schema.rake +6 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7226ffcb5e676cc4e890469a49e6aefd03edd77
|
4
|
+
data.tar.gz: 910a9f2b04490588311784ad4968691398b2a180
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9795cfbdcb5e59026805ff7b17f88d34481993a02e2f8d0c788934ff2354498fab9f7524ce904a63c0132ba510f3634241c66f7c72f5aec717b4094195f11c3e
|
7
|
+
data.tar.gz: bfb91bb6b3773a7a8ef8a78fa80cf40f65a1a9915de2813c3e21ba93a2e4819bb42d749449e95a6549c50600b246b950a6201d882b1015c19b4221ea68785d0e
|
data/lib/blueshift/version.rb
CHANGED
data/lib/tasks/schema.rake
CHANGED
@@ -6,9 +6,6 @@ require 'blueshift'
|
|
6
6
|
path = File.join(Dir.pwd, 'db')
|
7
7
|
logger = Logger.new(STDOUT)
|
8
8
|
|
9
|
-
Blueshift::POSTGRES_DB.logger = logger
|
10
|
-
Blueshift::REDSHIFT_DB.logger = logger
|
11
|
-
|
12
9
|
task :ensure_db_dir do
|
13
10
|
FileUtils.mkdir_p(path)
|
14
11
|
end
|
@@ -17,7 +14,7 @@ namespace :pg do
|
|
17
14
|
namespace :schema do
|
18
15
|
desc 'Dumps the Postgres schema to a file'
|
19
16
|
task :dump => :ensure_db_dir do
|
20
|
-
Blueshift::POSTGRES_DB.extension :
|
17
|
+
Blueshift::POSTGRES_DB.extension :schema_dumper
|
21
18
|
File.open(File.join(path, 'schema.rb'), 'w') { |f| f << Blueshift::POSTGRES_DB.dump_schema_migration(same_db: true) }
|
22
19
|
end
|
23
20
|
|
@@ -30,6 +27,7 @@ namespace :pg do
|
|
30
27
|
|
31
28
|
desc 'Runs migrations for Postgres'
|
32
29
|
task :migrate do
|
30
|
+
Blueshift::POSTGRES_DB.logger = logger
|
33
31
|
Blueshift::Migration.run_pg!
|
34
32
|
end
|
35
33
|
end
|
@@ -40,7 +38,7 @@ namespace :redshift do
|
|
40
38
|
desc 'Dumps the Postgres schema to a file'
|
41
39
|
task :dump => :ensure_db_dir do
|
42
40
|
Blueshift::REDSHIFT_DB.extension :redshift_schema_dumper
|
43
|
-
File.open(File.join(path, 'schema_redshift.rb'), 'w') { |f| f << Blueshift::REDSHIFT_DB.dump_schema_migration(same_db:
|
41
|
+
File.open(File.join(path, 'schema_redshift.rb'), 'w') { |f| f << Blueshift::REDSHIFT_DB.dump_schema_migration(same_db: false) }
|
44
42
|
end
|
45
43
|
|
46
44
|
desc 'Loads the Postgres schema from the file to the database'
|
@@ -52,6 +50,7 @@ namespace :redshift do
|
|
52
50
|
|
53
51
|
desc 'Runs migrations for Redshift'
|
54
52
|
task :migrate do
|
53
|
+
Blueshift::REDSHIFT_DB.logger = logger
|
55
54
|
Blueshift::Migration.run_redshift!
|
56
55
|
end
|
57
56
|
end
|
@@ -60,6 +59,8 @@ namespace :blueshift do
|
|
60
59
|
desc 'Runs migrations for both Postgres and Redshift'
|
61
60
|
task :migrate do
|
62
61
|
puts 'Running migrations for Postgres and Redshift...', ''
|
62
|
+
Blueshift::POSTGRES_DB.logger = logger
|
63
|
+
Blueshift::REDSHIFT_DB.logger = logger
|
63
64
|
Blueshift::Migration.run_both!
|
64
65
|
end
|
65
66
|
end
|