Merge pull request #2815 from okriuchykhin/ok_SCI_4958_v2

Add view mode field to the Asset model [SCI-4958]
This commit is contained in:
Alex Kriuchykhin 2020-09-16 13:47:59 +02:00 committed by GitHub
commit 7773ee09b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 = 60 * 30
enum view_mode: { show_as_thumbnail: 0, show_inline: 1 }
# ActiveStorage configuration
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,
file_processing boolean,
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'),
('20200622155632'),
('20200709142830'),
('20200714082503');
('20200714082503'),
('20200902093234');