Skip to content

Commit d05c09a

Browse files
committed
[MIGRATION] Increased char limit to member notes
1 parent c16de6c commit d05c09a

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

app/models/participant.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class Participant < ApplicationRecord
33
belongs_to :member
44
belongs_to :activity
55

6-
validates :notes, length: { maximum: 30 }
6+
validates :notes, length: { maximum: 100 } # This was 30 previously, but we saw no reason to keep it that short
77

88
before_destroy :rewrite_logs_before_delete!, prepend: true
99
is_impressionable dependent: :ignore

app/views/members/activities/partials/_view.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
.card-body.show-activity-topborder
8989
%strong
9090
= activity.notes
91-
%textarea.form-control.notes{:maxlength => '30', :value => (@enrollment.notes unless @enrollment.nil?)}
91+
%textarea.form-control.notes{:maxlength => '100', :value => (@enrollment.notes unless @enrollment.nil?)}
9292
= @enrollment.notes unless @enrollment.nil?
9393
.card-footer.clearfix
9494
.row
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class IncreaseCharLimToMemberNotes < ActiveRecord::Migration[6.1]
2+
def up
3+
change_column :participants, :notes, :string, :limit => 100
4+
end
5+
6+
def down
7+
change_column :participants, :notes, :string, :limit => 30
8+
end
9+
end

db/structure.sql

+3-2
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ CREATE TABLE public.participants (
728728
created_at timestamp without time zone,
729729
updated_at timestamp without time zone,
730730
reservist boolean DEFAULT false,
731-
notes character varying(30)
731+
notes character varying(100)
732732
);
733733

734734

@@ -1735,6 +1735,7 @@ INSERT INTO "schema_migrations" (version) VALUES
17351735
('20211012104341'),
17361736
('20220221195220'),
17371737
('20220406092056'),
1738-
('20220524203723');
1738+
('20220524203723'),
1739+
('20240125003700');
17391740

17401741

0 commit comments

Comments
 (0)