From 530929cb71359ccb098d3649c02e2e5afa7da95a Mon Sep 17 00:00:00 2001 From: Ellen Wittingen Date: Fri, 10 Jan 2025 20:13:40 +0100 Subject: [PATCH] merge? --- db/schema.rb | 21 +++++++++++++++++---- spec/models/sofia_account_spec.rb | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 1fbeb5f05..ec4d43130 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[7.0].define(version: 2024_04_13_094147) do +ActiveRecord::Schema[7.1].define(version: 2024_04_13_094147) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -43,7 +43,7 @@ t.index ["user_id"], name: "index_credit_mutations_on_user_id" end - create_table "sofia_accounts", force: :cascade do |t| + create_table "identities", force: :cascade do |t| t.string "username", null: false t.string "password_digest", null: false t.bigint "user_id", null: false @@ -52,8 +52,8 @@ t.datetime "deleted_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index ["user_id"], name: "index_sofia_accounts_on_user_id" - t.index ["username"], name: "index_sofia_accounts_on_username", unique: true + t.index ["user_id"], name: "index_identities_on_user_id" + t.index ["username"], name: "index_identities_on_username", unique: true end create_table "invoice_rows", force: :cascade do |t| @@ -169,6 +169,19 @@ t.index ["user_id"], name: "index_roles_users_on_user_id" end + create_table "sofia_accounts", force: :cascade do |t| + t.string "username", null: false + t.string "password_digest", null: false + t.bigint "user_id", null: false + t.string "otp_secret_key", null: false + t.boolean "otp_enabled", default: false + t.datetime "deleted_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["user_id"], name: "index_sofia_accounts_on_user_id" + t.index ["username"], name: "index_sofia_accounts_on_username", unique: true + end + create_table "users", force: :cascade do |t| t.string "name" t.datetime "deleted_at" diff --git a/spec/models/sofia_account_spec.rb b/spec/models/sofia_account_spec.rb index 68a1d4630..2c3f04721 100644 --- a/spec/models/sofia_account_spec.rb +++ b/spec/models/sofia_account_spec.rb @@ -62,7 +62,7 @@ let(:sofia_account) { create(:sofia_account, password: 'password1234') } context 'username' do - subject(:duplicate_sofia_account) { build_stubbed(:sofia_account, username: sofia_account.username) } + subject(:duplicate_sofia_account) { build(:sofia_account, username: sofia_account.username) } it { expect(duplicate_sofia_account).not_to be_valid } end