{"id":300862,"date":"2020-03-27T15:01:01","date_gmt":"2020-03-27T15:01:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=300862"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=300862","title":{"rendered":"EF Core + Oracle: \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b\u043c\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/custis\/blog\/494278\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3a\/lj\/or\/3aljorcjihhefstlxuybizl-3tg.png\"><\/p>\n<p>  \u041e\u0431\u044b\u0447\u043d\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a EF Core \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432&nbsp;\u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441&nbsp;MS SQL \u2014 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c Microsoft. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435&nbsp;\u0434\u043e\u0433\u043c\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b&nbsp;\u0432&nbsp;CUSTIS \u043f\u0438\u0448\u0435\u043c \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430&nbsp;C#, \u0430&nbsp;\u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Oracle. \u0412&nbsp;EF Core \u0435\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439, \u043d\u043e&nbsp;\u0432&nbsp;\u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0438 \u043d\u0435&nbsp;\u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b. \u0414\u0435\u043b\u043e \u0432&nbsp;\u0442\u043e\u043c, \u0447\u0442\u043e Oracle \u0438&nbsp;\u0440\u044f\u0434 \u0434\u0440\u0443\u0433\u0438\u0445 \u0411\u0414, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 MySQL, <a href=\"https:\/\/www.datasunrise.com\/blog\/professional-info\/how-popular-rdbmss-deal-with-ddl-commands-in-transactions\/\">\u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u0439 DDL<\/a>. \u0417\u043d\u0430\u0447\u0438\u0442, \u0435\u0441\u043b\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0443\u043f\u0430\u0434\u0435\u0442 \u0433\u0434\u0435-\u0442\u043e \u043f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435, \u0435\u0435&nbsp;\u043d\u0435&nbsp;\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0438&nbsp;\u043d\u0430\u043a\u0430\u0442\u0438\u0442\u044c, \u043d\u0438&nbsp;\u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c. \u041a\u0430\u043a \u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430&nbsp;EF Core \u0431\u0435\u0437 MS SQL?<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0430\u0442\u0447\u0435\u0439 \u043d\u0430&nbsp;\u0411\u0414 Oracle, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b&nbsp;\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432&nbsp;\u0440\u044f\u0434\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0415\u0433\u043e \u043f\u0438\u0441\u0430\u043b\u0438, \u043a\u043e\u0433\u0434\u0430 \u0435\u0449\u0435 \u043d\u0435&nbsp;\u0431\u044b\u043b\u043e Liquibase, \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 EF \u0438&nbsp;\u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u0430\u0442\u0447\u0435\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441&nbsp;\u0441\u043e\u0442\u043d\u0435\u0439 \u0411\u0414, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a, \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438, \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0438&nbsp;\u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. \u0421\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0411\u0414 \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0432&nbsp;\u0432\u0438\u0434\u0435 SQL- \u0438\u043b\u0438 m4-\u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432. \u0421&nbsp;\u0438\u0445&nbsp;\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0432&nbsp;\u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0435\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443: \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0438&nbsp;\u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c m4-\u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435&nbsp;\u0443\u043f\u0430\u0434\u0435\u0442, \u0430&nbsp;\u0443\u0432\u0438\u0434\u0438\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0438&nbsp;\u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0430\u0442\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437&nbsp;\u0434\u0432\u0443\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439:<\/p>\n<ol>\n<li>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0410.<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0412.<\/li>\n<\/ol>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u043a\u0440\u0438\u043f\u0442 \u0443\u043f\u0430\u0434\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0432&nbsp;Oracle \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0410. \u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u0442\u0447\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e: \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442, \u0447\u0442\u043e \u0410 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u0442 \u043a\u043e&nbsp;\u0432\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432 \u0443 \u043f\u0430\u0442\u0447\u0435\u0440\u0430 \u0432\u0441\u0435 \u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u2014 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0439 \u0438&nbsp;\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432&nbsp;CUSTIS. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c, \u0430&nbsp;\u0437\u0430&nbsp;\u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0442\u0430\u043a\u043e\u0439 \u043e\u043f\u044b\u0442 \u043d\u0435&nbsp;\u043e\u0447\u0435\u043d\u044c \u0446\u0435\u043d\u0435\u043d. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u0430\u0442\u0447\u0435\u0440 \u043d\u0435&nbsp;\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b Code First, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0411\u0414 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<p>  \u041c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0430\u0442\u0447\u0435\u0439 \u0438&nbsp;\u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438. \u0412 \u043a\u043e\u043d\u0446\u0435 2019 \u0433\u043e\u0434\u0430 \u043a\u0430\u043a \u0440\u0430\u0437 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430, \u043d\u0430&nbsp;\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b&nbsp;\u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434. \u0413\u043b\u0430\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043d\u0435\u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h2>\n<p>  \u0412 MS SQL \u0446\u0435\u043f\u043e\u0447\u043a\u0430 DDL-\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0438\u043b\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432&nbsp;\u0432\u0438\u0434\u0435 \u043e\u0434\u043d\u043e\u0439 \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u0412&nbsp;\u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u0412&nbsp;Oracle DDL \u043d\u0435\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a&nbsp;\u043d\u0435\u043a\u043e\u043d\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0411\u0414.<\/p>\n<p>  \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a&nbsp;\u043f\u0430\u0442\u0447\u0443, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u0438\u0437&nbsp;\u0434\u0432\u0443\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439: \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0410 \u0438&nbsp;B. \u0415\u0441\u043b\u0438 \u043c\u0438\u0433\u0440\u0430\u0442\u043e\u0440 \u0443\u043f\u0430\u0434\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0439, \u0432&nbsp;Oracle \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0410. \u041f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435&nbsp;\u0434\u0430\u0441\u0442 \u2014 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0443 <code>CREATE TABLE<\/code> \u043d\u0435&nbsp;\u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u0410 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u041e\u0442\u043a\u0430\u0442\u0438\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0442\u0430\u043a\u0436\u0435 \u043d\u0435&nbsp;\u0443\u0434\u0430\u0441\u0442\u0441\u044f: EF Core \u043f\u0438\u0448\u0435\u0442 \u0432&nbsp;\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0447\u0442\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430, \u0442\u043e\u043b\u044c\u043a\u043e \u0432&nbsp;\u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0421&nbsp;\u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f EF Core, \u0435\u0441\u043b\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0435\u0449\u0435 \u043d\u0435&nbsp;\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u0442\u043e \u0438&nbsp;\u043e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0447\u0435\u0433\u043e.<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041f\u043e\u0438\u0441\u043a \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f Oracle \u0432&nbsp;\u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u043d\u0435&nbsp;\u0434\u0430\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. \u0412\u0441\u0435, \u0447\u0442\u043e \u044f \u043d\u0430\u0448\u0435\u043b, \u2014 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u044b <a href=\"https:\/\/www.thereformedprogrammer.net\/handling-entity-framework-core-database-migrations-in-production-part-1\/\">\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f<\/a> \u0438&nbsp;<a href=\"https:\/\/www.thereformedprogrammer.net\/handling-entity-framework-core-database-migrations-in-production-part-2\/\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438<\/a> \u043f\u0430\u0442\u0447\u0435\u0439 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441&nbsp;EF. \u0427\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u043d\u0430&nbsp;StackOverflow \u043d\u0430\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430&nbsp;\u0438\u0434\u0435\u044e \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/microsoft.entityframeworkcore.migrations.imigrationssqlgenerator?view=efcore-3.1\">IMigrationsSqlGenerator<\/a>. \u042d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430&nbsp;\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 SQL-\u043a\u043e\u0434\u0430, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 EF.<\/p>\n<p>  \u0412 \u043f\u0430\u043a\u0435\u0442 <a href=\"https:\/\/www.nuget.org\/packages\/Oracle.EntityFrameworkCore\/\">Oracle.EntityFrameworkCore<\/a> \u0432\u043a\u043b\u044e\u0447\u0435\u043d OracleMigrationsSqlGenerator, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 IMigrationsSqlGenerator. \u041a&nbsp;\u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0435\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043b\u043e\u043d\u043a\u0443, \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"sql\">ALTER TABLE MY_TABLE ADD (MY_COLUMN DATE)<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043a\u043e\u0434 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432&nbsp;\u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0411\u0414.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 OracleMigrationsSqlGenerator. \u0417\u0430\u0434\u0430\u0447\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u043e\u0441\u0438\u043b\u044c\u043d\u043e\u0439, \u0438&nbsp;\u044f&nbsp;\u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b \u043a&nbsp;\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u043c\u0438\u0433\u0440\u0430\u0442\u043e\u0440\u0430. \u0422\u0430\u043a \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f <a href=\"https:\/\/www.nuget.org\/packages\/CUSTIS.OracleIdempotentSqlGenerator\/\">CUSTIS.OracleIdempotentSqlGenerator<\/a>.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439 EF \u043d\u0430\u0448 \u043c\u0438\u0433\u0440\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0431\u044b\u043b\u0430 \u043b\u0438 \u043e\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0440\u0430\u043d\u0435\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043b\u043e\u043d\u043a\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a:<\/p>\n<pre><code class=\"sql\">DECLARE     i NUMBER; BEGIN     SELECT COUNT(*) INTO i     FROM user_tab_columns     WHERE table_name = UPPER('MY_TABLE') AND column_name = UPPER('MY_COLUMN');     IF I != 1 THEN         EXECUTE IMMEDIATE 'ALTER TABLE MY_TABLE ADD (MY_COLUMN DATE)';       END IF;        END;<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043b\u0438\u0448\u044c \u043f\u043e\u0434\u043c\u0435\u043d\u0438\u0442\u044c <code>IMigrationsSqlGenerator<\/code> \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435:<\/p>\n<pre><code class=\"cs\">public class MyDbContext : DbContext {     protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)     {         optionsBuilder.ReplaceService&lt;IMigrationsSqlGenerator, IdempotentSqlGenerator&gt;();     } }<\/code><\/pre>\n<p>  \u041c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f <a href=\"https:\/\/docs.microsoft.com\/ru-ru\/ef\/core\/managing-schemas\/migrations\/?tabs=dotnet-core-cli\">\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0434\u043b\u044f EF Core \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438<\/a>:<\/p>\n<pre><code class=\"cs\">dotnet ef migrations add v1.0.1 dotnet ef database update<\/code><\/pre>\n<p>  \u041e\u0431\u0449\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 <a href=\"https:\/\/www.nuget.org\/packages\/CUSTIS.OracleIdempotentSqlGenerator\/\">CUSTIS.OracleIdempotentSqlGenerator<\/a>, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432&nbsp;\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u0445, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f MySQL, MariaDB, Teradata, AmazonAurora \u0438&nbsp;\u0434\u0440\u0443\u0433\u0438\u0445 \u0411\u0414, \u0432&nbsp;\u043a\u043e\u0442\u043e\u0440\u044b\u0445 DDL \u043d\u0435&nbsp;\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u043c.<\/p>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <a href=\"https:\/\/www.nuget.org\/packages\/CUSTIS.OracleIdempotentSqlGenerator\/\">\u041f\u0430\u043a\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 NuGet<\/a><br \/>  <a href=\"https:\/\/github.com\/CUSTIS-public\/CUSTIS.OracleIdempotentSqlGenerator\">\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043d\u0430 GitHub<\/a><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/custis\/blog\/494278\/\"> https:\/\/habr.com\/ru\/company\/custis\/blog\/494278\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/custis\/blog\/494278\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3a\/lj\/or\/3aljorcjihhefstlxuybizl-3tg.png\"><\/p>\n<p>  \u041e\u0431\u044b\u0447\u043d\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a EF Core \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432&nbsp;\u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441&nbsp;MS SQL \u2014 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c Microsoft. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435&nbsp;\u0434\u043e\u0433\u043c\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b&nbsp;\u0432&nbsp;CUSTIS \u043f\u0438\u0448\u0435\u043c \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430&nbsp;C#, \u0430&nbsp;\u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Oracle. \u0412&nbsp;EF Core \u0435\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439, \u043d\u043e&nbsp;\u0432&nbsp;\u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0438 \u043d\u0435&nbsp;\u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b. \u0414\u0435\u043b\u043e \u0432&nbsp;\u0442\u043e\u043c, \u0447\u0442\u043e Oracle \u0438&nbsp;\u0440\u044f\u0434 \u0434\u0440\u0443\u0433\u0438\u0445 \u0411\u0414, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 MySQL, <a href=\"https:\/\/www.datasunrise.com\/blog\/professional-info\/how-popular-rdbmss-deal-with-ddl-commands-in-transactions\/\">\u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u0439 DDL<\/a>. \u0417\u043d\u0430\u0447\u0438\u0442, \u0435\u0441\u043b\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0443\u043f\u0430\u0434\u0435\u0442 \u0433\u0434\u0435-\u0442\u043e \u043f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435, \u0435\u0435&nbsp;\u043d\u0435&nbsp;\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0438&nbsp;\u043d\u0430\u043a\u0430\u0442\u0438\u0442\u044c, \u043d\u0438&nbsp;\u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c. \u041a\u0430\u043a \u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430&nbsp;EF Core \u0431\u0435\u0437 MS SQL?  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-300862","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=300862"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300862\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=300862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=300862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=300862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}