2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 12:06:56 +08:00
|
|
|
class RemoveSiteId < ActiveRecord::Migration[4.2]
|
2013-02-06 03:16:51 +08:00
|
|
|
def up
|
|
|
|
drop_table 'sites'
|
2013-03-23 23:02:59 +08:00
|
|
|
remove_index 'incoming_links', name: "incoming_index"
|
|
|
|
add_index "incoming_links", ["forum_thread_id", "post_number"], name: "incoming_index"
|
2013-02-06 03:16:51 +08:00
|
|
|
remove_column 'incoming_links', 'site_id'
|
2013-03-23 23:02:59 +08:00
|
|
|
remove_index 'users', name: 'index_users_on_site_id'
|
2013-02-06 03:16:51 +08:00
|
|
|
remove_column 'users', 'site_id'
|
2013-02-26 00:42:20 +08:00
|
|
|
|
2013-03-23 23:02:59 +08:00
|
|
|
remove_index 'expression_types', name: 'index_expression_types_on_site_id_and_expression_index'
|
|
|
|
remove_index 'expression_types', name: 'index_expression_types_on_site_id_and_name'
|
2017-07-28 09:20:09 +08:00
|
|
|
remove_column 'expression_types', 'site_id'
|
2013-03-23 23:02:59 +08:00
|
|
|
add_index "expression_types", ["expression_index"], unique: true
|
|
|
|
add_index "expression_types", ["name"], unique: true
|
2013-02-26 00:42:20 +08:00
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
drop_table 'forums'
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
raise 'not reversable'
|
|
|
|
end
|
|
|
|
end
|