pork_sandwich 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -1,5 +1,5 @@
1
1
  class PorkSandwichMigration < ActiveRecord::Migration
2
- self.up
2
+ def self.up
3
3
  create_table :twitter_accounts do |t|
4
4
  t.integer :twitter_id, :limit => 8
5
5
  t.integer :twitter_id_for_search, :limit => 8
@@ -99,30 +99,32 @@ class PorkSandwichMigration < ActiveRecord::Migration
99
99
  t.timestamps
100
100
  end
101
101
 
102
-
103
- execute "alter table tweets " +
104
- "alter column time_of_tweet type timestamp with time zone;"
105
- execute "alter table tweets " +
106
- "alter column created_at type timestamp with time zone;"
107
- execute "alter table tweets " +
108
- "alter column updated_at type timestamp with time zone;"
109
- execute "alter table twitter_accounts " +
110
- "alter column time_of_user_creation type timestamp with time zone;"
111
- execute "alter table twitter_accounts " +
112
- "alter column created_at type timestamp with time zone;"
113
- execute "alter table twitter_accounts " +
114
- "alter column updated_at type timestamp with time zone;"
115
- execute "alter table taggings " +
102
+ begin
103
+ execute "alter table tweets " +
104
+ "alter column time_of_tweet type timestamp with time zone;"
105
+ execute "alter table tweets " +
116
106
  "alter column created_at type timestamp with time zone;"
117
- execute "alter table trends " +
118
- "alter column created_at type timestamp with time zone;"
119
- execute "alter table trends " +
120
- "alter column updated_at type timestamp with time zone;"
121
- execute "alter table tweet_reactions " +
122
- "alter column created_at type timestamp with time zone;"
123
- execute "alter table tweet_reactions " +
124
- "alter column updated_at type timestamp with time zone;"
125
-
107
+ execute "alter table tweets " +
108
+ "alter column updated_at type timestamp with time zone;"
109
+ execute "alter table twitter_accounts " +
110
+ "alter column time_of_user_creation type timestamp with time zone;"
111
+ execute "alter table twitter_accounts " +
112
+ "alter column created_at type timestamp with time zone;"
113
+ execute "alter table twitter_accounts " +
114
+ "alter column updated_at type timestamp with time zone;"
115
+ execute "alter table taggings " +
116
+ "alter column created_at type timestamp with time zone;"
117
+ execute "alter table trends " +
118
+ "alter column created_at type timestamp with time zone;"
119
+ execute "alter table trends " +
120
+ "alter column updated_at type timestamp with time zone;"
121
+ execute "alter table tweet_reactions " +
122
+ "alter column created_at type timestamp with time zone;"
123
+ execute "alter table tweet_reactions " +
124
+ "alter column updated_at type timestamp with time zone;"
125
+ rescue SQLException => e
126
+ puts e + "\n" + "Migration failed to change timestamp column data types pork_sandwich tables. Attempted to change all timestamp without time zone types to timestamp with time zone types. Tables will still properly process and store time zone data for timestamps, but will not export UTC offset on COPY to."
127
+ end
126
128
  reaction_types = ['retweet', 'mention', 'reply']
127
129
  reaction_types.each do |r|
128
130
  unless Reaction.find_by_reaction_type(r)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pork_sandwich
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Gilbert