discourse/db/migrate/20191230055237_add_access_control_columns_to_upload.rb
2023-01-09 11:59:41 +00:00

21 lines
552 B
Ruby

# frozen_string_literal: true
class AddAccessControlColumnsToUpload < ActiveRecord::Migration[6.0]
def up
add_reference :uploads,
:access_control_post,
foreign_key: {
to_table: :posts,
},
index: true,
null: true
add_column :uploads, :original_sha1, :string, null: true
add_index :uploads, :original_sha1
end
def down
remove_column :uploads, :access_control_post_id
remove_column :uploads, :original_sha1
end
end