From bcd73c5548666bae7fef57e7e22cb61126308259 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Tue, 31 Dec 2024 19:31:37 +0100 Subject: =?UTF-8?q?megaPush=20=F0=9F=98=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20241231134759_add_name_to_tartiflettes.rb | 5 +++++ db/schema.rb | 3 ++- db/seeds.rb | 17 +++++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20241231134759_add_name_to_tartiflettes.rb (limited to 'db') diff --git a/db/migrate/20241231134759_add_name_to_tartiflettes.rb b/db/migrate/20241231134759_add_name_to_tartiflettes.rb new file mode 100644 index 0000000..cc74a0a --- /dev/null +++ b/db/migrate/20241231134759_add_name_to_tartiflettes.rb @@ -0,0 +1,5 @@ +class AddNameToTartiflettes < ActiveRecord::Migration[8.0] + def change + add_column :tartiflettes, :name, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index eb5b7e8..4be092f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.0].define(version: 2024_12_27_181134) do +ActiveRecord::Schema[8.0].define(version: 2024_12_31_134759) do create_table "scores", force: :cascade do |t| t.integer "tartiflette_id", null: false t.integer "scoring_criterium_id", null: false @@ -41,6 +41,7 @@ ActiveRecord::Schema[8.0].define(version: 2024_12_27_181134) do t.integer "scoring_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "name" end create_table "users", force: :cascade do |t| diff --git a/db/seeds.rb b/db/seeds.rb index 7fb3253..c70512c 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -10,14 +10,23 @@ User.create!( email_address: "wtt@marius-peter.com", - password: "password", - password_confirmation: "password", + password: "#wtt2024", + password_confirmation: "#wtt2024", admin: true ) puts "Seeded admin account" -(1..8).each do |id| - Tartiflette.create!(scoring_id: id) +[ "Tartiff Clofi", + "Tartiff Caraïbe-Ananas", + "L'Irrésistible", + "[quatre]", + "[cinq]", + "[six]", + "[sept]", + "[huit]", +].each_with_index do |name, id| + scoring_id = id + 1 + Tartiflette.create!(name: name, scoring_id: scoring_id) end puts "Seeded tartiflettes" -- cgit v1.2.3