From 2a18f08a0fa9287c883c0f5e35a34f4bc374e815 Mon Sep 17 00:00:00 2001 From: Kostiantyn Kostiuk Date: Sun, 11 Feb 2024 21:55:30 +0200 Subject: [PATCH] Add contest information on contest page Signed-off-by: Kostiantyn Kostiuk --- app/views/contests/show.html.erb | 1 + db/migrate/20240211194031_add_info_to_contests.rb | 5 +++++ db/structure.sql | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20240211194031_add_info_to_contests.rb diff --git a/app/views/contests/show.html.erb b/app/views/contests/show.html.erb index e69de29b..e38593ca 100644 --- a/app/views/contests/show.html.erb +++ b/app/views/contests/show.html.erb @@ -0,0 +1 @@ +<%== contest.info %> diff --git a/db/migrate/20240211194031_add_info_to_contests.rb b/db/migrate/20240211194031_add_info_to_contests.rb new file mode 100644 index 00000000..187f10f5 --- /dev/null +++ b/db/migrate/20240211194031_add_info_to_contests.rb @@ -0,0 +1,5 @@ +class AddInfoToContests < ActiveRecord::Migration[7.0] + def change + add_column :contests, :info, :text, null: false, default: '' + end +end diff --git a/db/structure.sql b/db/structure.sql index c862b4f9..9574f139 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -195,7 +195,8 @@ CREATE TABLE public.contests ( main_judge character varying DEFAULT ''::character varying NOT NULL, head_of_organizing_committee character varying DEFAULT ''::character varying NOT NULL, secretary_of_organizing_committee character varying DEFAULT ''::character varying NOT NULL, - head_of_appeal_commission character varying DEFAULT ''::character varying NOT NULL + head_of_appeal_commission character varying DEFAULT ''::character varying NOT NULL, + info text DEFAULT ''::text NOT NULL ); @@ -926,6 +927,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20230902145309'), ('20230930203405'), ('20231110173126'), -('20240203172343'); +('20240203172343'), +('20240211194031');