Skip to content

Instantly share code, notes, and snippets.

@pacarvalho
Created April 17, 2022 15:00
Show Gist options
  • Save pacarvalho/da8c5f1b5517ebb9abe4f72716f83ee8 to your computer and use it in GitHub Desktop.
Save pacarvalho/da8c5f1b5517ebb9abe4f72716f83ee8 to your computer and use it in GitHub Desktop.
Medium Article - Custom Backend Video Model Migration
class CreateVideo < ActiveRecord::Migration[6.1]
def change
create_table :videos, id: :uuid do |t|
t.string :key, unique: true, index: true
t.string :low_res_key, unique: true, index: true
t.references :user, foreign_key: true, type: :uuid
t.timestamps
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment