diff --git a/db/migrate/20210827164533_add_p_grade_references_to_p_articles.rb b/db/migrate/20210827164533_add_p_grade_references_to_p_articles.rb new file mode 100644 index 0000000..6185877 --- /dev/null +++ b/db/migrate/20210827164533_add_p_grade_references_to_p_articles.rb @@ -0,0 +1,5 @@ +class AddPGradeReferencesToPArticles < ActiveRecord::Migration[6.0] + def change + add_reference :p_articles, :p_grade, foreign_key: true + end +end diff --git a/db/schema.rb b/db/schema.rb index feae45f..6f8e516 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.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"