2023-07-03 21:54:11 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class AddShareableLinks < ActiveRecord::Migration[6.1]
|
|
|
|
def change
|
|
|
|
create_table :shareable_links do |t|
|
2023-07-05 22:21:26 +08:00
|
|
|
t.string :uuid, index: true
|
2023-07-03 21:54:11 +08:00
|
|
|
t.string :description
|
|
|
|
t.references :shareable, polymorphic: true, index: true
|
|
|
|
t.references :team, index: true, foreign_key: { to_table: :teams }
|
|
|
|
t.references :created_by, index: true, foreign_key: { to_table: :users }
|
|
|
|
t.references :last_modified_by, index: true, foreign_key: { to_table: :users }
|
|
|
|
|
|
|
|
t.timestamps
|
|
|
|
end
|
|
|
|
|
|
|
|
add_column :teams, :shareable_links_enabled, :boolean, default: false, null: false
|
|
|
|
end
|
|
|
|
end
|