At startup:
rake db:migrate
only files that are in db / migrate / right are processed?
Well, since application / models define relationships such as one-to-one, one-to-many, and many-to-many relationships, how does Rails apply such relationships? After migrating and viewing the generated database schema, I do not see foreign key constraints. So it baffles me how it all works.
Quite simple.
This is due to the need to support multiple databases. Some, like sqlite, do not support foreign keys.
, SQL .
, Rails SQL, . , , .
, , DDL, Rails , - , ( , , ). , ( , ). . Enterprise Rails Dan Chak; , .
, . , foreign_key_migrations .
foreign_key_migrations
Source: https://habr.com/ru/post/1702883/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1702878/what-are-some-programming-techniques-for-converting-sd-images-to-hd-images&usg=ALkJrhg4mTecbmSYO1rcfQjg0XKFG6fZ_QWPF: создание очереди в потоке с таймерами - multithreadingДелает ли PartialView то, что я думаю, должен (а не)? - jqueryDoes the ubiquitous base object have an anti-pattern? - designHow to program this game with basic knowledge of C # and ASP.NET? - c #Web service with a lot of connections - mysqlExamples where Java is more elegant than C #? - javaHQL instruction "Contains"? - containsMemory allocation in std :: map - c ++Linq-to-entity: how to create objects (new Xyz () vs CreateXyz ())? - entity-frameworkAll Articles