discourse/db/migrate/20130522193615_rename_search_tables.rb
Sam Saffron 30990006a9 DEV: enable frozen string literal on all files
This reduces chances of errors where consumers of strings mutate inputs
and reduces memory usage of the app.

Test suite passes now, but there may be some stuff left, so we will run
a few sites on a branch prior to merging
2019-05-13 09:31:32 +08:00

22 lines
753 B
Ruby

# frozen_string_literal: true
class RenameSearchTables < ActiveRecord::Migration[4.2]
def up
rename_table :users_search, :user_search_data
rename_column :user_search_data, :id, :user_id
rename_table :categories_search, :category_search_data
rename_column :category_search_data, :id, :category_id
rename_table :posts_search, :post_search_data
rename_column :post_search_data, :id, :post_id
end
def down
rename_table :user_search_data, :users_search
rename_column :users_search, :user_id, :id
rename_table :category_search_data, :categories_search
rename_column :categories_search, :category_id, :id
rename_table :post_search_data, :posts_search
rename_column :posts_search, :post_id, :id
end
end