Commit 92f813ea authored by marcheing's avatar marcheing Committed by Diego de Araújo Martinez Camarinha

Add encoded content model

parent 7eea6602
class EncodedContent < ApplicationRecord
has_attached_file :video,
storage: :s3,
s3_credentials: AWSSettings.to_h,
s3_region: AWSSettings.aws_region
validates_attachment :video, presence: true
validates_attachment_content_type :video, content_type: /\Avideo\/.*\Z/
end
class AddEncodedContent < ActiveRecord::Migration[5.0]
def change
create_table :encoded_contents do |t|
t.integer :content_id, null: false
t.integer :job_id, null: false
t.integer :output_id
t.integer :file_size
t.integer :width
t.integer :height
t.integer :duration
t.string :state
t.attachment :video
t.timestamps
end
end
end
......@@ -49,6 +49,23 @@ ActiveRecord::Schema.define(version: 20160701135238) do
t.index ["priority", "run_at"], name: "delayed_jobs_priority"
end
create_table "encoded_contents", force: :cascade do |t|
t.integer "content_id", null: false
t.integer "job_id", null: false
t.integer "output_id"
t.integer "file_size"
t.integer "width"
t.integer "height"
t.integer "duration"
t.string "state"
t.string "video_file_name"
t.string "video_content_type"
t.integer "video_file_size"
t.datetime "video_updated_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "profiles", force: :cascade do |t|
t.string "first_name"
t.string "last_name"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment