add migration and adapt fixture and factories

This commit is contained in:
viehlieb 2023-02-21 15:17:19 +01:00
parent c28731a1ea
commit ace6551880
4 changed files with 24 additions and 6 deletions

View file

@ -0,0 +1,6 @@
class AddPricePerToArticles < ActiveRecord::Migration[7.0]
def change
add_column :articles, :price_per, :float, default: 0.0
add_column :articles, :unit_symbol, :string
end
end

View file

@ -10,7 +10,17 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2023_01_06_144440) do
ActiveRecord::Schema[7.0].define(version: 2023_02_20_214408) do
create_table "action_text_rich_texts", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
t.string "name", null: false
t.text "body", size: :long
t.string "record_type", null: false
t.bigint "record_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
end
create_table "active_storage_attachments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
@ -75,6 +85,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_06_144440) do
t.datetime "deleted_at", precision: nil
t.string "type"
t.integer "quantity", default: 0
t.float "price_per", default: 0.0
t.string "unit_symbol"
t.index ["article_category_id"], name: "index_articles_on_article_category_id"
t.index ["name", "supplier_id"], name: "index_articles_on_name_and_supplier_id"
t.index ["supplier_id"], name: "index_articles_on_supplier_id"
@ -282,7 +294,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_06_144440) do
create_table "messages", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
t.integer "sender_id"
t.string "subject", null: false
t.text "body"
t.boolean "private", default: false
t.datetime "created_at", precision: nil
t.integer "reply_to"