mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
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:
commit
7773ee09b2
3 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
5
db/migrate/20200902093234_add_view_mode_to_asset.rb
Normal file
5
db/migrate/20200902093234_add_view_mode_to_asset.rb
Normal 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
|
|
@ -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');
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue