From 385441486ed13f3add75dd9097fe26dd343e95ed Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Wed, 18 Feb 2026 15:56:33 +0100 Subject: [PATCH] add username --- db/migrate/20260211102848_add_username_to_users.rb | 7 +++++++ db/schema.rb | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20260211102848_add_username_to_users.rb diff --git a/db/migrate/20260211102848_add_username_to_users.rb b/db/migrate/20260211102848_add_username_to_users.rb new file mode 100644 index 0000000..2b355ae --- /dev/null +++ b/db/migrate/20260211102848_add_username_to_users.rb @@ -0,0 +1,7 @@ +class AddUsernameToUsers < ActiveRecord::Migration[8.0] + def up + add_column :users, :username, :string + User.update_all(username: "temporary") + change_column_null :users, :username, false + end +end diff --git a/db/schema.rb b/db/schema.rb index 4395fff..ead11b4 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: 2026_01_27_150339) do +ActiveRecord::Schema[8.0].define(version: 2026_02_11_102848) do create_table "moods", force: :cascade do |t| t.string "mode" t.datetime "recorded_at" @@ -46,6 +46,7 @@ ActiveRecord::Schema[8.0].define(version: 2026_01_27_150339) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.datetime "invitation_accepted_at" + t.string "username", null: false t.index ["email_address"], name: "index_users_on_email_address", unique: true end