add p_grade references to p_article

This commit is contained in:
Barnabé 2021-08-27 18:51:14 +02:00
parent bea1f58564
commit b61ff2567f
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,5 @@
class AddPGradeReferencesToPArticles < ActiveRecord::Migration[6.0]
def change
add_reference :p_articles, :p_grade, foreign_key: true
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_08_27_164230) do
ActiveRecord::Schema.define(version: 2021_08_27_164533) do
create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "name"
@ -985,6 +985,8 @@ ActiveRecord::Schema.define(version: 2021_08_27_164230) do
t.bigint "p_product_ref_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.bigint "p_grade_id"
t.index ["p_grade_id"], name: "index_p_articles_on_p_grade_id"
t.index ["p_product_ref_id"], name: "index_p_articles_on_p_product_ref_id"
end
@ -3112,6 +3114,7 @@ ActiveRecord::Schema.define(version: 2021_08_27_164230) do
add_foreign_key "p_article_serial_nums", "p_articles"
add_foreign_key "p_article_serial_nums", "p_serial_num_types"
add_foreign_key "p_article_serial_nums", "p_serial_num_values"
add_foreign_key "p_articles", "p_grades"
add_foreign_key "p_articles", "p_product_refs"
add_foreign_key "p_commercial_object_brands", "p_commercial_objectives"
add_foreign_key "p_commercial_object_brands", "p_commercials"