Add view mode field to the Asset model [SCI-4958]

This commit is contained in:
Oleksii Kriuchykhin 2020-09-02 15:02:56 +02:00
parent 8adc841f86
commit a508b07275
3 changed files with 11 additions and 2 deletions

View file

@ -12,6 +12,8 @@ class Asset < ApplicationRecord
# Lock duration set to 30 minutes # Lock duration set to 30 minutes
LOCK_DURATION = 60 * 30 LOCK_DURATION = 60 * 30
enum view_mode: { show_as_thumbnail: 0, show_inline: 1 }
# ActiveStorage configuration # ActiveStorage configuration
has_one_attached :file has_one_attached :file

View file

@ -0,0 +1,5 @@
class AddViewModeToAsset < ActiveRecord::Migration[6.0]
def change
add_column :assets, :view_mode, :integer, default: 0, null: false
end
end

View file

@ -224,7 +224,8 @@ CREATE TABLE public.assets (
version integer DEFAULT 1, version integer DEFAULT 1,
file_processing boolean, file_processing boolean,
team_id integer, team_id integer,
file_image_quality integer file_image_quality integer,
view_mode integer DEFAULT 0 NOT NULL
); );
@ -7283,6 +7284,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200622140843'), ('20200622140843'),
('20200622155632'), ('20200622155632'),
('20200709142830'), ('20200709142830'),
('20200714082503'); ('20200714082503'),
('20200902093234');