blue-shift 0.0.2 → 0.0.3

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: 7a52af4406d213a8437391b173949c1a052275e6
4
- data.tar.gz: c9626f7ca6049730d8afbabe686b515b9e4a9ecf
3
+ metadata.gz: fbdb82fbebfd1c8a3535c8b23e454236334fc174
4
+ data.tar.gz: d7f4925e8a96b773d4cf47a6adedd452d86fddf8
5
5
  SHA512:
6
- metadata.gz: 75d418562c8142619bb5e055d1645e75c8c5ca362f1dfbd2601339ca4c50103768f81a8afe28ce8920ac8b0ccc95fb18121810a47ad6f7974ff07f4a1843de2c
7
- data.tar.gz: d96f4afb5b6cc5963eaa3c8693fe6d28f714724e5a435bb8affdd148211fb4dd953a4568cbf58be09eb3a3f3d23d46baeb4f213bd8d54b2399c5330106abc662
6
+ metadata.gz: 7ff31243b99c2af428ce80d54a6e5dfdcc9528b68b1b22ebad70f5f6b24a1605ffed4342041ddbf1717c71d0d6834cfde7559d03272e381ba1bd9486594d7200
7
+ data.tar.gz: 7d476d66ab8af83aa0e5961d17c2a5e6fb525d5a38bec5ff4760aee41dcc996b5b354914ce6b608781ca4e0a24d9e3f5c71a1087c9a95cd34e8d195642e5433c
@@ -1,3 +1,3 @@
1
1
  module Blueshift
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
@@ -18,6 +18,10 @@ module Sequel
18
18
  []
19
19
  end
20
20
 
21
+ def supports_index_parsing?
22
+ false
23
+ end
24
+
21
25
  private
22
26
 
23
27
  def create_table_sql(name, generator, options)
@@ -98,9 +102,6 @@ module Sequel
98
102
  end
99
103
  end
100
104
 
101
- # OVERRIDE since indexes are not enforced by Redshift
102
- def indexes(table, opts=OPTS)
103
- end
104
105
  end
105
106
 
106
107
  class Dataset < Postgres::Dataset
@@ -4,6 +4,7 @@ require 'fileutils'
4
4
  require 'blueshift'
5
5
 
6
6
  path = File.join(Dir.pwd, 'db')
7
+ logger = Logger.new(STDOUT)
7
8
 
8
9
  task :ensure_db_dir do
9
10
  FileUtils.mkdir_p(path)
@@ -13,13 +14,16 @@ namespace :pg do
13
14
  namespace :schema do
14
15
  desc 'Dumps the Postgres schema to a file'
15
16
  task :dump => :ensure_db_dir do
17
+ Blueshift::POSTGRES_DB.logger = logger
16
18
  Blueshift::POSTGRES_DB.extension :redshift_schema_dumper
17
19
  File.open(File.join(path, 'schema.rb'), 'w') { |f| f << Blueshift::POSTGRES_DB.dump_schema_migration(same_db: true) }
18
20
  end
19
21
 
20
22
  desc 'Loads the Postgres schema from the file to the database'
21
23
  task :load => :ensure_db_dir do
22
- eval(File.join(path, 'schema.rb')).apply(Blueshift::POSTGRES_DB, :up)
24
+ Blueshift::POSTGRES_DB.logger = logger
25
+ eval(File.read(File.join(path, 'schema.rb'))).apply(Blueshift::POSTGRES_DB, :up)
26
+ puts 'loaded schema into Postgres'
23
27
  end
24
28
  end
25
29
  end
@@ -29,13 +33,16 @@ namespace :redshift do
29
33
  namespace :schema do
30
34
  desc 'Dumps the Postgres schema to a file'
31
35
  task :dump => :ensure_db_dir do
36
+ Blueshift::REDSHIFT_DB.logger = logger
32
37
  Blueshift::REDSHIFT_DB.extension :redshift_schema_dumper
33
38
  File.open(File.join(path, 'schema_redshift.rb'), 'w') { |f| f << Blueshift::REDSHIFT_DB.dump_schema_migration(same_db: true) }
34
39
  end
35
40
 
36
41
  desc 'Loads the Postgres schema from the file to the database'
37
42
  task :load => :ensure_db_dir do
38
- eval(File.join(path, 'schema_redshift.rb')).apply(Blueshift::REDSHIFT_DB, :up)
43
+ Blueshift::REDSHIFT_DB.logger = logger
44
+ eval(File.read(File.join(path, 'schema_redshift.rb'))).apply(Blueshift::REDSHIFT_DB, :up)
45
+ puts 'loaded schema into Redshift'
39
46
  end
40
47
  end
41
48
  end
@@ -44,6 +51,8 @@ namespace :blueshift do
44
51
  desc 'Runs migrations for both Postgres and Redshift'
45
52
  task :migrate do
46
53
  puts 'Running migrations for Postgres and Redshift...', ''
54
+ Blueshift::POSTGRES_DB.logger = logger
55
+ Blueshift::REDSHIFT_DB.logger = logger
47
56
  Blueshift::Migration.run!
48
57
  end
49
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blue-shift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Mansour