pork_sandwich 0.4.1 → 0.4.2
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.
- data/VERSION +1 -1
- data/generators/pork_sandwich_migration/templates/migration.rb +26 -24
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
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
|
-
|
104
|
-
|
105
|
-
|
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
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
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)
|