Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
31d4b47d
Commit
31d4b47d
authored
Jan 18, 2022
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add url_text column to issuable metric images
Changelog: added
parent
68755b38
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
0 deletions
+29
-0
db/migrate/20220118015633_add_url_text_to_issuable_metric_images.rb
.../20220118015633_add_url_text_to_issuable_metric_images.rb
+10
-0
db/migrate/20220118020026_add_url_text_limit_to_issuable_metric_images.rb
...118020026_add_url_text_limit_to_issuable_metric_images.rb
+13
-0
db/schema_migrations/20220118015633
db/schema_migrations/20220118015633
+1
-0
db/schema_migrations/20220118020026
db/schema_migrations/20220118020026
+1
-0
db/structure.sql
db/structure.sql
+2
-0
ee/app/models/issuable_metric_image.rb
ee/app/models/issuable_metric_image.rb
+1
-0
ee/spec/models/issuable_metric_image_spec.rb
ee/spec/models/issuable_metric_image_spec.rb
+1
-0
No files found.
db/migrate/20220118015633_add_url_text_to_issuable_metric_images.rb
0 → 100644
View file @
31d4b47d
# frozen_string_literal: true
class
AddUrlTextToIssuableMetricImages
<
Gitlab
::
Database
::
Migration
[
1.0
]
# rubocop:disable Migration/AddLimitToTextColumns
# limit is added in 20220118020026_add_url_text_limit_to_issuable_metric_images
def
change
add_column
:issuable_metric_images
,
:url_text
,
:text
end
# rubocop:enable Migration/AddLimitToTextColumns
end
db/migrate/20220118020026_add_url_text_limit_to_issuable_metric_images.rb
0 → 100644
View file @
31d4b47d
# frozen_string_literal: true
class
AddUrlTextLimitToIssuableMetricImages
<
Gitlab
::
Database
::
Migration
[
1.0
]
disable_ddl_transaction!
def
up
add_text_limit
:issuable_metric_images
,
:url_text
,
128
end
def
down
remove_text_limit
:issuable_metric_images
,
:url_text
end
end
db/schema_migrations/20220118015633
0 → 100644
View file @
31d4b47d
6a73f49306de7c799a39afa3ac1f761840860833a96f1a91cf992c9a3ebfef9b
\ No newline at end of file
db/schema_migrations/20220118020026
0 → 100644
View file @
31d4b47d
77374c81456f235d3afeb45cdda14552e1ef8047de5aaa3f5bb0a82e4aebe849
\ No newline at end of file
db/structure.sql
View file @
31d4b47d
...
...
@@ -15348,6 +15348,8 @@ CREATE TABLE issuable_metric_images (
file_store smallint,
file text NOT NULL,
url text,
url_text text,
CONSTRAINT check_3bc6d47661 CHECK ((char_length(url_text) <= 128)),
CONSTRAINT check_5b3011e234 CHECK ((char_length(url) <= 255)),
CONSTRAINT check_7ed527062f CHECK ((char_length(file) <= 255))
);
ee/app/models/issuable_metric_image.rb
View file @
31d4b47d
...
...
@@ -15,6 +15,7 @@ class IssuableMetricImage < ApplicationRecord
validates
:file
,
presence:
true
validate
:validate_file_is_image
validates
:url
,
length:
{
maximum:
255
},
public_url:
{
allow_blank:
true
}
validates
:url_text
,
length:
{
maximum:
128
}
scope
:order_created_at_asc
,
->
{
order
(
created_at: :asc
)
}
...
...
ee/spec/models/issuable_metric_image_spec.rb
View file @
31d4b47d
...
...
@@ -15,6 +15,7 @@ RSpec.describe IssuableMetricImage do
it
{
is_expected
.
not_to
allow_value
(
txt_file
).
for
(
:file
)
}
it
{
is_expected
.
to
allow_value
(
img_file
).
for
(
:file
)
}
it
{
is_expected
.
to
validate_length_of
(
:url_text
).
is_at_most
(
128
)
}
describe
'url'
do
it
{
is_expected
.
not_to
allow_value
(
'test'
).
for
(
:url
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment