discourse/db/migrate/20250606170129_create_optimized_videos.rb
Blake Erickson af3abb54e3
FEATURE: Add support for aws MediaConvert (#33092)
When enabled this will convert uploaded videos to a standard format that should
be playable on all devices and browsers.

The goal of this feature is to prevent codec playback issues that
sometimes can occur with video uploads.

It uses an adapter pattern, so that other services for video conversion
could be easily added in the future.
2025-07-23 11:58:33 -06:00

19 lines
611 B
Ruby

# frozen_string_literal: true
class CreateOptimizedVideos < ActiveRecord::Migration[7.2]
def change
create_table :optimized_videos do |t|
t.integer :upload_id, null: false
t.integer :optimized_upload_id, null: false
t.string :adapter
t.timestamps
end
add_index :optimized_videos, :upload_id
add_index :optimized_videos, :optimized_upload_id
add_index :optimized_videos, %i[upload_id adapter], unique: true
add_foreign_key :optimized_videos, :uploads, column: :upload_id
add_foreign_key :optimized_videos, :uploads, column: :optimized_upload_id
end
end