add username

This commit is contained in:
Christophe Robillard 2026-02-18 15:56:33 +01:00
parent 56fd287b0f
commit 385441486e
2 changed files with 9 additions and 1 deletions

View file

@ -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

3
db/schema.rb generated
View file

@ -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