Commit f62d9b94 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Adam Hegyi

Add boolean 'external' column to custom emoji table

parent 00b75ff4
---
title: Add external column to custom emoji table
merge_request: 37346
author: Rajendra Kadam
type: added
# frozen_string_literal: true
class AddExternalToCustomEmoji < ActiveRecord::Migration[6.0]
DOWNTIME = false
def change
add_column :custom_emoji, :external, :boolean, default: true, null: false
end
end
...@@ -10918,6 +10918,7 @@ CREATE TABLE public.custom_emoji ( ...@@ -10918,6 +10918,7 @@ CREATE TABLE public.custom_emoji (
updated_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL,
name text NOT NULL, name text NOT NULL,
file text NOT NULL, file text NOT NULL,
external boolean DEFAULT true NOT NULL,
CONSTRAINT check_8c586dd507 CHECK ((char_length(name) <= 36)), CONSTRAINT check_8c586dd507 CHECK ((char_length(name) <= 36)),
CONSTRAINT check_dd5d60f1fb CHECK ((char_length(file) <= 255)) CONSTRAINT check_dd5d60f1fb CHECK ((char_length(file) <= 255))
); );
...@@ -23998,5 +23999,6 @@ COPY "schema_migrations" (version) FROM STDIN; ...@@ -23998,5 +23999,6 @@ COPY "schema_migrations" (version) FROM STDIN;
20200718040100 20200718040100
20200718040200 20200718040200
20200718040300 20200718040300
20200720154123
\. \.
...@@ -8,6 +8,7 @@ RSpec.describe CustomEmoji do ...@@ -8,6 +8,7 @@ RSpec.describe CustomEmoji do
it { is_expected.to have_db_column(:file) } it { is_expected.to have_db_column(:file) }
it { is_expected.to validate_length_of(:name).is_at_most(36) } it { is_expected.to validate_length_of(:name).is_at_most(36) }
it { is_expected.to validate_presence_of(:name) } it { is_expected.to validate_presence_of(:name) }
it { is_expected.to have_db_column(:external) }
end end
describe 'exclusion of duplicated emoji' do describe 'exclusion of duplicated emoji' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment