update with changes from Production branch

This commit is contained in:
Lee Lawlor
2014-02-17 12:05:39 -05:00
parent 5b640cf9d8
commit a4937fb2e5
384 changed files with 14690 additions and 2242 deletions

View File

@ -0,0 +1,29 @@
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :login, :null => false # optional, you can use email instead, or both
t.string :email, :null => false # optional, you can use login instead, or both
t.string :crypted_password, :null => false # optional, see below
t.string :password_salt, :null => false # optional, but highly recommended
t.string :persistence_token, :null => false # required
#t.string :single_access_token, :null => false # optional, see Authlogic::Session::Params
t.string :perishable_token, :null => false # optional, see Authlogic::Session::Perishability
# Magic columns, just like ActiveRecord's created_at and updated_at. These are automatically maintained by Authlogic if they are present.
#t.integer :login_count, :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns
#t.integer :failed_login_count, :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns
#t.datetime :last_request_at # optional, see Authlogic::Session::MagicColumns
t.datetime :current_login_at # optional, see Authlogic::Session::MagicColumns
t.datetime :last_login_at # optional, see Authlogic::Session::MagicColumns
t.string :current_login_ip # optional, see Authlogic::Session::MagicColumns
t.string :last_login_ip
t.timestamps
end
end
def self.down
drop_table :users
end
end

View File

@ -0,0 +1,18 @@
class CreateApiKeys < ActiveRecord::Migration
def self.up
create_table :api_keys do |t|
t.string :api_key, :limit => 16
t.integer :device_id
t.integer :feed_id
t.integer :user_id
t.boolean :write_flag, :default => 0
t.boolean :public_flag, :default => 0
t.timestamps
end
end
def self.down
drop_table :api_keys
end
end

View File

@ -0,0 +1,11 @@
class AddIndexesToApiKey < ActiveRecord::Migration
def self.up
add_index :api_keys, :api_key, :unique => true
add_index :api_keys, :device_id
end
def self.down
remove_index :api_keys, :device_id
remove_index :api_keys, :api_key
end
end

View File

@ -0,0 +1,9 @@
class RemoveFeedIdFromApiKey < ActiveRecord::Migration
def self.up
remove_column :api_keys, :feed_id
end
def self.down
add_column :api_keys, :feed_id, :integer
end
end

View File

@ -0,0 +1,22 @@
class CreateFeeds < ActiveRecord::Migration
def self.up
create_table :feeds do |t|
t.integer :device_id
t.text :raw_data
t.text :data1
t.text :data2
t.text :data3
t.text :data4
t.text :data5
t.text :data6
t.text :data7
t.text :data8
t.timestamps
end
end
def self.down
drop_table :feeds
end
end

View File

@ -0,0 +1,9 @@
class AddIndexToFeeds < ActiveRecord::Migration
def self.up
add_index :feeds, :device_id
end
def self.down
remove_index :feeds, :device_id
end
end

View File

@ -0,0 +1,9 @@
class AddTimeZoneToUser < ActiveRecord::Migration
def self.up
add_column :users, :time_zone, :string
end
def self.down
remove_column :users, :time_zone
end
end

View File

@ -0,0 +1,9 @@
class AddEntryIdToFeeds < ActiveRecord::Migration
def self.up
add_column :feeds, :entry_id, :integer
end
def self.down
remove_column :feeds, :entry_id
end
end

View File

@ -0,0 +1,9 @@
class AddNoteToApiKeys < ActiveRecord::Migration
def self.up
add_column :api_keys, :note, :string
end
def self.down
remove_column :api_keys, :note
end
end

View File

@ -0,0 +1,23 @@
class ChangeFeedDataToFields < ActiveRecord::Migration
def self.up
rename_column :feeds, :data1, :field1
rename_column :feeds, :data2, :field2
rename_column :feeds, :data3, :field3
rename_column :feeds, :data4, :field4
rename_column :feeds, :data5, :field5
rename_column :feeds, :data6, :field6
rename_column :feeds, :data7, :field7
rename_column :feeds, :data8, :field8
end
def self.down
rename_column :feeds, :field1, :data1
rename_column :feeds, :field2, :data2
rename_column :feeds, :field3, :data3
rename_column :feeds, :field4, :data4
rename_column :feeds, :field5, :data5
rename_column :feeds, :field6, :data6
rename_column :feeds, :field7, :data7
rename_column :feeds, :field8, :data8
end
end

View File

@ -0,0 +1,9 @@
class AddStatusToFeeds < ActiveRecord::Migration
def self.up
add_column :feeds, :status, :string
end
def self.down
remove_column :feeds, :status
end
end

View File

@ -0,0 +1,23 @@
class AddFieldOptionsToChannels < ActiveRecord::Migration
def self.up
add_column :channels, :options1, :text
add_column :channels, :options2, :text
add_column :channels, :options3, :text
add_column :channels, :options4, :text
add_column :channels, :options5, :text
add_column :channels, :options6, :text
add_column :channels, :options7, :text
add_column :channels, :options8, :text
end
def self.down
remove_column :channels, :options1
remove_column :channels, :options2
remove_column :channels, :options3
remove_column :channels, :options4
remove_column :channels, :options5
remove_column :channels, :options6
remove_column :channels, :options7
remove_column :channels, :options8
end
end

View File

@ -0,0 +1,15 @@
class CreateTags < ActiveRecord::Migration
def self.up
create_table :tags do |t|
t.string :name
t.timestamps
end
add_index :tags, :name
end
def self.down
drop_table :tags
end
end

View File

@ -0,0 +1,16 @@
class CreateTaggings < ActiveRecord::Migration
def self.up
create_table :taggings do |t|
t.integer :tag_id
t.integer :channel_id
t.timestamps
end
add_index :taggings, :tag_id
add_index :taggings, :channel_id
end
def self.down
drop_table :taggings
end
end

View File

@ -0,0 +1,13 @@
class AddGeolocationToFeed < ActiveRecord::Migration
def self.up
add_column :feeds, :latitude, :decimal, :precision => 15, :scale => 10
add_column :feeds, :longitude, :decimal, :precision => 15, :scale => 10
add_column :feeds, :elevation, :string
end
def self.down
remove_column :feeds, :latitude
remove_column :feeds, :longitude
remove_column :feeds, :elevation
end
end

View File

@ -0,0 +1,23 @@
class CreateTwitters < ActiveRecord::Migration
def self.up
create_table :twitters do |t|
t.string :screen_name
t.integer :user_id
t.integer :twitter_id
t.string :token
t.string :secret
t.timestamps
end
add_index :twitters, :user_id
add_index :twitters, :twitter_id
end
def self.down
remove_index :twitters, :user_id
remove_index :twitters, :twitter_id
drop_table :twitters
end
end

View File

@ -0,0 +1,11 @@
class AddApiKeyToTwitters < ActiveRecord::Migration
def self.up
add_column :twitters, :api_key, :string, :limit => 16
add_index :twitters, :api_key
end
def self.down
remove_index :twitters, :api_key
remove_column :twitters, :api_key
end
end

View File

@ -0,0 +1,14 @@
class CreateHeaders < ActiveRecord::Migration
def self.up
create_table :headers do |t|
t.string :name
t.string :value
t.timestamps
end
end
def self.down
drop_table :headers
end
end

View File

@ -0,0 +1,21 @@
class CreatePlugins < ActiveRecord::Migration
def self.up
create_table :plugins do |t|
t.string :name
t.integer :user_id
t.text :html
t.text :css
t.text :js
t.timestamps
end
add_index :plugins, :user_id
end
def self.down
remove_index :plugins, :user_id
drop_table :plugins
end
end

View File

@ -0,0 +1,23 @@
class ChangeFeedFieldsToStrings < ActiveRecord::Migration
def self.up
change_column :feeds, :field1, :string
change_column :feeds, :field2, :string
change_column :feeds, :field3, :string
change_column :feeds, :field4, :string
change_column :feeds, :field5, :string
change_column :feeds, :field6, :string
change_column :feeds, :field7, :string
change_column :feeds, :field8, :string
end
def self.down
change_column :feeds, :field1, :text
change_column :feeds, :field2, :text
change_column :feeds, :field3, :text
change_column :feeds, :field4, :text
change_column :feeds, :field5, :text
change_column :feeds, :field6, :text
change_column :feeds, :field7, :text
change_column :feeds, :field8, :text
end
end

View File

@ -0,0 +1,39 @@
class ChangeChannelFieldsToStrings < ActiveRecord::Migration
def self.up
change_column :channels, :field1, :string
change_column :channels, :field2, :string
change_column :channels, :field3, :string
change_column :channels, :field4, :string
change_column :channels, :field5, :string
change_column :channels, :field6, :string
change_column :channels, :field7, :string
change_column :channels, :field8, :string
change_column :channels, :options1, :string
change_column :channels, :options2, :string
change_column :channels, :options3, :string
change_column :channels, :options4, :string
change_column :channels, :options5, :string
change_column :channels, :options6, :string
change_column :channels, :options7, :string
change_column :channels, :options8, :string
end
def self.down
change_column :channels, :field1, :text
change_column :channels, :field2, :text
change_column :channels, :field3, :text
change_column :channels, :field4, :text
change_column :channels, :field5, :text
change_column :channels, :field6, :text
change_column :channels, :field7, :text
change_column :channels, :field8, :text
change_column :channels, :options1, :text
change_column :channels, :options2, :text
change_column :channels, :options3, :text
change_column :channels, :options4, :text
change_column :channels, :options5, :text
change_column :channels, :options6, :text
change_column :channels, :options7, :text
change_column :channels, :options8, :text
end
end

View File

@ -0,0 +1,9 @@
class AddCreatedAtIndexToFeeds < ActiveRecord::Migration
def self.up
add_index :feeds, :created_at
end
def self.down
remove_index :feeds, :created_at
end
end

View File

@ -0,0 +1,13 @@
class AddDoubleIndexToFeeds < ActiveRecord::Migration
def self.up
remove_index :feeds, :channel_id
remove_index :feeds, :created_at
add_index :feeds, [:channel_id, :created_at]
end
def self.down
remove_index :feeds, [:channel_id, :created_at]
add_index :feeds, :channel_id
add_index :feeds, :created_at
end
end

View File

@ -0,0 +1,9 @@
class AddChannelIdEntryIdIndexToFeeds < ActiveRecord::Migration
def self.up
add_index :feeds, [:channel_id, :entry_id]
end
def self.down
remove_index :feeds, [:channel_id, :entry_id]
end
end

View File

@ -0,0 +1,19 @@
class CreatePipes < ActiveRecord::Migration
def self.up
create_table :pipes do |t|
t.string :name, :null => false
t.string :url, :null => false
t.string :slug, :null => false, :unique => true
t.timestamps
end
add_index :pipes, :slug
end
def self.down
remove_index :pipes, :slug
drop_table :pipes
end
end

View File

@ -0,0 +1,11 @@
class AddFieldsToPipes < ActiveRecord::Migration
def self.up
add_column :pipes, :parse, :string
add_column :pipes, :cache, :integer
end
def self.down
remove_column :pipes, :parse
remove_column :pipes, :cache
end
end

View File

@ -0,0 +1,15 @@
class AddSocialToChannels < ActiveRecord::Migration
def self.up
add_column :channels, :social, :boolean, :default => 0
add_column :channels, :slug, :string
add_index :channels, :slug
end
def self.down
remove_index :channels, :slug
remove_column :channels, :slug
remove_column :channels, :social
end
end

View File

@ -0,0 +1,9 @@
class AddLocationToFeeds < ActiveRecord::Migration
def self.up
add_column :feeds, :location, :string, :after => :elevation
end
def self.down
remove_column :feeds, :location
end
end

View File

@ -0,0 +1,9 @@
class AddStatusToChannels < ActiveRecord::Migration
def self.up
add_column :channels, :status, :string
end
def self.down
remove_column :channels, :status
end
end

View File

@ -0,0 +1,9 @@
class AddUrlToChannel < ActiveRecord::Migration
def self.up
add_column :channels, :url, :string
end
def self.down
remove_column :channels, :status
end
end

View File

@ -0,0 +1,17 @@
class CreateComments < ActiveRecord::Migration
def self.up
create_table :comments do |t|
t.integer :parent_id
t.text :body
t.integer :flags
t.integer :user_id
t.string :ip_address
t.timestamps
end
end
def self.down
drop_table :comments
end
end

View File

@ -0,0 +1,9 @@
class AddChannelIdToComments < ActiveRecord::Migration
def self.up
add_column :comments, :channel_id, :integer
end
def self.down
remove_column :comments, :channel_id
end
end

View File

@ -0,0 +1,9 @@
class AddIndicesToComments < ActiveRecord::Migration
def self.up
add_index :comments, :channel_id
end
def self.down
remove_index :comments, :channel_id
end
end

View File

@ -0,0 +1,18 @@
class CreateWatchings < ActiveRecord::Migration
def self.up
create_table :watchings do |t|
t.integer :user_id
t.integer :channel_id
t.timestamps
end
add_index :watchings, [:user_id, :channel_id]
end
def self.down
remove_index :watchings, [:user_id, :channel_id]
drop_table :watchings
end
end

View File

@ -0,0 +1,11 @@
class AddVideoFieldsToChannels < ActiveRecord::Migration
def self.up
add_column :channels, :video_id, :string
add_column :channels, :video_type, :string
end
def self.down
remove_column :channels, :video_id
remove_column :channels, :video_type
end
end

View File

@ -0,0 +1,13 @@
class AddFieldsToUsers < ActiveRecord::Migration
def self.up
add_column :users, :public_flag, :boolean, :default => false
add_column :users, :bio, :text
add_column :users, :website, :string
end
def self.down
remove_column :users, :website
remove_column :users, :bio
remove_column :users, :public_flag
end
end

View File

@ -0,0 +1,15 @@
class CreateFailedlogins < ActiveRecord::Migration
def self.up
create_table :failedlogins do |t|
t.string :login
t.string :password
t.string :ip_address
t.timestamps
end
end
def self.down
drop_table :failedlogins
end
end

View File

@ -0,0 +1,9 @@
class RenameTwittersTable < ActiveRecord::Migration
def self.up
rename_table :twitters, :twitter_accounts
end
def self.down
rename_table :twitter_accounts, :twitters
end
end

View File

@ -0,0 +1,11 @@
class AddIndexToChannels < ActiveRecord::Migration
def self.up
add_index :channels, :user_id
add_index :channels, [:public_flag, :last_entry_id, :updated_at], :name => 'channels_public_viewable'
end
def self.down
remove_index :channels, :user_id
remove_index :channels, :name => 'channels_public_viewable'
end
end

View File

@ -0,0 +1,9 @@
class AddIndexToUserLogins < ActiveRecord::Migration
def self.up
add_index :users, :login
end
def self.down
remove_index :users, :login
end
end

View File

@ -0,0 +1,9 @@
class AddIndexToHeadersTable < ActiveRecord::Migration
def self.up
add_index :headers, :thinghttp_id
end
def self.down
remove_index :headers, :thinghttp_id
end
end

View File

@ -0,0 +1,15 @@
class CreateWindows < ActiveRecord::Migration
def self.up
create_table :windows do |t|
t.integer :channel_id
t.integer :plugin_id
t.integer :position
t.timestamps
end
end
def self.down
drop_table :windows
end
end

View File

@ -0,0 +1,9 @@
class AddHtmlToWindow < ActiveRecord::Migration
def self.up
add_column :windows, :html, :text
end
def self.down
remove_column :windows, :html
end
end

View File

@ -0,0 +1,9 @@
class AddIndexToUsers < ActiveRecord::Migration
def self.up
add_index :users, :email
end
def self.down
remove_index :users, :email
end
end

View File

@ -0,0 +1,9 @@
class AddClearingFlagToChannel < ActiveRecord::Migration
def self.up
add_column :channels, :clearing, :boolean, :null => false, :default => false
end
def self.down
remove_column :channels, :clearing
end
end

View File

@ -0,0 +1,11 @@
class AddColToWindows < ActiveRecord::Migration
def self.up
add_column :windows, :col, :integer
add_column :windows, :title, :string
end
def self.down
remove_column :windows, :title
remove_column :windows, :col
end
end

View File

@ -0,0 +1,9 @@
class RemovePluginIdFromWindow < ActiveRecord::Migration
def self.up
remove_column :windows, :plugin_id
end
def self.down
add_column :windows, :plugin_id, :string
end
end

View File

@ -0,0 +1,9 @@
class AddWtypeToWindows < ActiveRecord::Migration
def self.up
add_column :windows, :wtype, :string
end
def self.down
remove_column :windows, :wtype
end
end

View File

@ -0,0 +1,9 @@
class AddNameToWindow < ActiveRecord::Migration
def self.up
add_column :windows, :name, :string
end
def self.down
remove_column :windows, :name
end
end

View File

@ -0,0 +1,14 @@
class CreateChartWindowDetails < ActiveRecord::Migration
def self.up
create_table :chart_window_details do |t|
t.integer :chart_window_id
t.integer :field_number
t.timestamps
end
end
def self.down
drop_table :chart_window_details
end
end

View File

@ -0,0 +1,13 @@
class CreatePortletWindowDetails < ActiveRecord::Migration
def self.up
create_table :portlet_window_details do |t|
t.integer :portlet_window_id
t.timestamps
end
end
def self.down
drop_table :portlet_window_details
end
end

View File

@ -0,0 +1,9 @@
class AddTypeToWindow < ActiveRecord::Migration
def self.up
add_column :windows, :type, :string
end
def self.down
remove_column :windows, :type
end
end

View File

@ -0,0 +1,9 @@
class AddOptionsToChartWindowDetails < ActiveRecord::Migration
def self.up
add_column :chart_window_details, :options, :string
end
def self.down
remove_column :chart_window_details, :options
end
end

View File

@ -0,0 +1,9 @@
class AddPrivateFlagToWindows < ActiveRecord::Migration
def self.up
add_column :windows, :private_flag, :boolean, :default => false
end
def self.down
remove_column :windows, :private_flag
end
end

View File

@ -0,0 +1,9 @@
class AddShowFlagToWindows < ActiveRecord::Migration
def self.up
add_column :windows, :show_flag, :boolean, :default => true
end
def self.down
remove_column :windows, :show_flag
end
end

View File

@ -0,0 +1,9 @@
class AddPrivateFlagToPlugins < ActiveRecord::Migration
def self.up
add_column :plugins, :private_flag, :boolean, :default => true
end
def self.down
remove_column :plugins, :private_flag
end
end

View File

@ -0,0 +1,14 @@
class CreatePluginWindowDetails < ActiveRecord::Migration
def self.up
create_table :plugin_window_details do |t|
t.integer :plugin_id
t.integer :plugin_window_id
t.timestamps
end
end
def self.down
drop_table :plugin_window_details
end
end

View File

@ -0,0 +1,9 @@
class AddRankingToChannel < ActiveRecord::Migration
def self.up
add_column :channels, :ranking, :integer
end
def self.down
remove_column :channels, :ranking
end
end

View File

@ -0,0 +1,8 @@
class AddIndexToChannel < ActiveRecord::Migration
def self.up
add_index(:channels, :ranking)
end
def self.down
end
end

View File

@ -0,0 +1,6 @@
class ChangeApiKey < ActiveRecord::Migration
def change
change_column :twitter_accounts, :api_key, :string
end
end

View File

@ -0,0 +1,6 @@
class ChangeApiKeyLimit < ActiveRecord::Migration
def change
change_column :twitter_accounts, :api_key, :string, :limit => 17, :null => false
end
end

View File

@ -0,0 +1,7 @@
class AddIndexesToPortlets < ActiveRecord::Migration
def change
add_index :windows, :channel_id
add_index :portlet_window_details, :portlet_window_id
end
end

View File

@ -0,0 +1,6 @@
class AddIndexToChartWindowDetails < ActiveRecord::Migration
def change
add_index :chart_window_details, :chart_window_id
end
end

View File

@ -0,0 +1,6 @@
class AddPersistenceIndexToUsers < ActiveRecord::Migration
def change
add_index :users, :persistence_token
end
end

View File

@ -0,0 +1,6 @@
class AddIndexToPluginWindowDetails < ActiveRecord::Migration
def change
add_index :plugin_window_details, :plugin_window_id
end
end

View File

@ -0,0 +1,6 @@
class AddApiKeyToUsers < ActiveRecord::Migration
def change
add_column :users, :api_key, :string, :limit => 16
end
end

View File

@ -0,0 +1,6 @@
class AddIndexOnApiKeysToUser < ActiveRecord::Migration
def change
add_index :users, :api_key
end
end

View File

@ -0,0 +1,15 @@
class CreateDailyFeeds < ActiveRecord::Migration
def change
create_table :daily_feeds do |t|
t.integer :channel_id
t.date :date
t.string :calculation, :limit => 20
t.string :result
t.timestamps
end
add_index :daily_feeds, [:channel_id, :date]
end
end

View File

@ -0,0 +1,12 @@
class RemoveTimestampsFromDailyFeeds < ActiveRecord::Migration
def up
remove_column :daily_feeds, :created_at
remove_column :daily_feeds, :updated_at
end
def down
add_column :daily_feeds, :created_at, :datetime
add_column :daily_feeds, :updated_at, :datetime
end
end

View File

@ -0,0 +1,6 @@
class AddFieldToDailyFeeds < ActiveRecord::Migration
def change
add_column :daily_feeds, :field, :integer, :limit => 1
end
end

View File

@ -0,0 +1,6 @@
class RemoveRawDataFromFeeds < ActiveRecord::Migration
def change
remove_column :feeds, :raw_data
end
end

View File

@ -0,0 +1,6 @@
class ChangeTwitterAccountsTwitterId < ActiveRecord::Migration
def change
change_column :twitter_accounts, :twitter_id, :integer, :limit => 8
end
end