العلاقات بين الجداول
العلاقة OneToOne
https://orkhan.gitbook.io/typeorm/docs/one-to-one-relations
https://typeorm.biunav.com/en/one-to-one-relations.html
العلاقة Many-to-one / one-to-many
https://typeorm.biunav.com/en/many-to-one-one-to-many-relations.html
سؤال محمد جداً:
https://stackoverflow.com/questions/54965381/how-to-insert-an-entity-with-onetomany-relation-in-nestjs
لربط جدول من جهة واحدة:
العلاقات حسب تجربتي تكون بهذا النحو:
بعض المشاكل:
مشكلة:
#1828 - Cannot drop column 'firstJobDesireId': needed in a foreign key constraint
تكون هذه المشكلة عادةً بسبب المفتاح الأجنبي فلا يمكن إسقاط الحقل في حالة كان مفتاحاً أجنبياً
الحل:
ALTER TABLE `employment_application` DROP FOREIGN KEY `FK_7b172675864e7c31a3c31f89875`;
ALTER TABLE `employment_application` DROP COLUMN `firstJobDesireId`;
تعليقات
إرسال تعليق