mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-11 17:00:41 +08:00
Add view mode field to the Asset model [SCI-4958]
This commit is contained in:
parent
8adc841f86
commit
a508b07275
3 changed files with 11 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
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,
|
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');
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue