{"id":303392,"date":"2020-05-11T21:00:28","date_gmt":"2020-05-11T21:00:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=303392"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=303392","title":{"rendered":"\u0428\u0435\u0441\u0442\u044c \u0441\u043e\u0432\u0435\u0442\u043e\u0432 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 PostgreSQL \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445"},"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\/post\/501454\/\">\n<p>\u0412 2018-\u043c \u0433\u043e\u0434\u0443, \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u0432 <em>Akvelon Inc.<\/em>, \u044f \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043b \u043e\u0434\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u041f\u0435\u0440\u0435\u0434 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e \u043c\u043d\u0435 \u0434\u0430\u043b\u0438 \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0435\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435: \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0442\u0438\u043f\u0443 \u0437\u0430\u043f\u0438\u0441\u043d\u043e\u0439 \u043a\u043d\u0438\u0436\u043a\u0438 \u0438\u043b\u0438 todo-\u0441\u043f\u0438\u0441\u043a\u0430 \u2013 React\\TypeScript, C# \u043d\u0430 \u0431\u044d\u043a\u0435 \u0438 MS SQL Server \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043c\u043e\u0434\u043d\u043e\u0435: \u0441 \u043e\u0431\u0438\u043b\u0438\u0435\u043c unit-\u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 mock\u2019\u0430\u0445, \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432 docker-\u043e\u0431\u0440\u0430\u0437 \u2013 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f. \u0418 \u0443 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u044b\u043b \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u2013 \u043e\u043d\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. \u0421\u043e\u0432\u0441\u0435\u043c. \u041f\u0430\u0434\u0430\u043b\u043e \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dm\/im\/sb\/dmimsbwf3txk0dgcfmtsvyjrmmu.jpeg\"><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u0438\u043b \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0438\u0437 \u043d\u0438\u0445 \u2013 \u043b\u043e\u0436\u043d\u0430\u044f \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u0414\u0430\u0436\u0435 100% \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u043a\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>  <\/p>\n<p>\u0418 \u0432\u0442\u043e\u0440\u0430\u044f \u2013 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0421\u0423\u0411\u0414, \u0442\u043e \u0432\u044b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u0418 \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435: \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0421\u0423\u0411\u0414, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0443 \u0432\u0430\u0441 \u0432 production\u2019\u0435. \u0414\u0443\u043c\u0430\u044e, \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u043e\u0434 <em>Oracle<\/em>, \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u044e\u0449\u0438\u0435 \u0441\u0432\u043e\u0438 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 H2\\HSQLDB, \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0433\u0434\u0430 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442, \u0430 production \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 (<em>boolean<\/em>, <em>group by<\/em> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0447\u0443\u0434\u0435\u0441\u0430).<\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441 <em>PostgreSQL<\/em> \u0438 \u043c\u0438\u0433\u0440\u0438\u0440\u0443\u044e \u043d\u0430\u0448\u0438 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0441 10-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0430 11-\u0443\u044e. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 (\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u043e\u043e\u0431\u0449\u0435) \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043d\u044e\u0430\u043d\u0441\u0430\u043c\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3 id=\"ispolzuyte-sovremennye-instrumenty\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/h3>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0441 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u043d\u0443: \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/yandex-qatools\/postgresql-embedded\" rel=\"nofollow\">Embedded PostgreSQL<\/a> \u0438\u0437 <em>Yandex QATools<\/em>. \u041f\u0440\u043e\u0435\u043a\u0442 \u0443\u0441\u0442\u0430\u0440\u0435\u043b \u0438 \u0434\u0430\u0432\u043d\u043e \u043d\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043b\u0438\u0431\u043e <a href=\"https:\/\/www.testcontainers.org\/\" rel=\"nofollow\">TestContainers<\/a>,<\/li>\n<li>\u043b\u0438\u0431\u043e <a href=\"https:\/\/github.com\/opentable\/otj-pg-embedded\" rel=\"nofollow\">otj-pg-embedded<\/a>,<\/li>\n<li>\u043b\u0438\u0431\u043e \u0435\u0433\u043e <a href=\"https:\/\/github.com\/zonkyio\/embedded-postgres\" rel=\"nofollow\">\u0444\u043e\u0440\u043a<\/a> \u043e\u0442 <em>Zonky<\/em>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0442\u0435\u043c\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <em>TestContainers<\/em> \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0430, \u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c Docker\u2019\u0430 \u0441\u0434\u0435\u043b\u0430\u043b\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u0430\u043b\u043e\u043f\u0440\u0438\u0433\u043e\u0434\u043d\u044b\u043c \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043d\u0430\u0448\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0438\u043c\u0435\u043d\u043d\u043e <em>otj-pg-embedded<\/em>. \u041e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441 \u0432\u0430\u0448\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/habr.com\/ru\/company\/hh\/blog\/333616\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u0440\u0435\u0431\u044f\u0442 \u0438\u0437 HeadHunter \u0438\u043b\u0438 \u043d\u0430 <a href=\"https:\/\/dzone.com\/articles\/spring-boot-with-embedded-postgresql-for-dao-integ\" rel=\"nofollow\">DZone<\/a>. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0430 \u0438\u0437 <em>Yandex QATools<\/em> \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <em>otj-pg-embedded<\/em> \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0434 <em>Windows<\/em> \u0438 <em>MacOS<\/em> \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0432\u0434\u0440\u0443\u0433 \u043f\u043e\u0439\u0434\u0451\u0442 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0411\u0414. \u0410 \u0435\u0449\u0451 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <em>Liquibase<\/em> \u0438 <em>Flyway<\/em> \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">abstract class DatabaseAwareTestBase {     @RegisterExtension     static final PreparedDbExtension embeddedPostgres =             EmbeddedPostgresExtension.preparedDatabase(                     LiquibasePreparer.forClasspathLocation(&quot;changelogs\/changelog.xml&quot;)); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 <a href=\"https:\/\/github.com\/mfvanek\/pg-index-health-demo\" rel=\"nofollow\">GitHub<\/a>.<\/p>\n<p>  <\/p>\n<h3 id=\"pravilno-ochischayte-tablicy-bd-posle-testirovaniya\">\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u0447\u0438\u0449\u0430\u0439\u0442\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0411\u0414 \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043e\u0447\u0438\u0441\u0442\u043a\u043e\u0439 \u0411\u0414 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u0441\u0442\u0430\u043c\u0438. \u0422\u0438\u043f\u043e\u0432\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <em>PostgreSQL<\/em> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442: \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0411\u0414 \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u043d\u0430\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0435.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e, \u043a\u043e\u0433\u0434\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0435\u0441\u0442 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0411\u0414 \u0432 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u043d\u043e, \u0443\u0432\u044b, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u043e. \u0415\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c, \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0438 \u0435\u0451 \u043e\u0442\u043a\u0430\u0442\u0435 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u0442\u0435\u0441\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439 \u0435\u043c\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0430 \u0432\u0441\u0435\u0445 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 <code>delete from &lt;table&gt;<\/code> \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u043b\u0430\u043d\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0439 \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>truncate<\/strong>. \u041d\u044e\u0430\u043d\u0441 \u0432 \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043e\u0447\u0438\u0441\u0442\u043a\u0438. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c <strong>truncate<\/strong> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u0430\u0431\u043b\u0438\u0446, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e <strong>cascade<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">truncate table tableA; truncate table tableB cascade; truncate table tableE;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435, \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0432 \u043e\u0434\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e: \u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u043a \u0411\u0414, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">truncate table tableA, tableB, tableC, tableD, tableE;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <strong>cascade<\/strong>, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435; \u043e\u0431 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f \u0421\u0423\u0411\u0414. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043c\u043d\u043e\u0433\u043e \u0442\u0430\u0431\u043b\u0438\u0446, \u0442\u043e \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u0441 \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<h3 id=\"obyazatelno-proveryayte-versiyu-subd-v-testah\">\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435 \u0432\u0435\u0440\u0441\u0438\u044e \u0421\u0423\u0411\u0414 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445<\/h3>\n<p>  <\/p>\n<p>\u0422\u0440\u0435\u0442\u044c\u044f \u0432\u0435\u0449\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u0432\u0430\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445, \u044d\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 \u0421\u0423\u0411\u0414, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f. \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b, \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u043c\u0438\u0433\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448\u0438 \u0431\u0430\u0437\u044b \u043d\u0430 11-\u0439 Postgres (\u043f\u0440\u0438\u0447\u0435\u043c 11-\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u0430\u044f, \u0434\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0430 12-\u0443\u044e). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 <em>otj-pg-embedded<\/em> \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u0435\u0433\u043e \u0444\u043e\u0440\u043a\u0430 \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 <em>Zonky<\/em>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c <a href=\"https:\/\/github.com\/zonkyio\/embedded-postgres\/issues\/31\" rel=\"nofollow\">\u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0421\u0423\u0411\u0414<\/a>, \u0443\u043a\u0430\u0437\u0430\u0432 \u0435\u0451 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">testImplementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:11.6.0') testImplementation 'io.zonky.test:embedded-postgres:1.2.6'<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0430\u043c \u0442\u0435\u0441\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043c \u043d\u0430 100% \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0421\u0423\u0411\u0414.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">    @Test     void checkPostgresVersion() {         final String pgVersion = jdbcTemplate.queryForObject(&quot;select version();&quot;, String.class);         assertThat(pgVersion, startsWith(&quot;PostgreSQL 11.6&quot;));     }<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"zapuskayte-testy-na-vseh-platformah\">\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0439\u0442\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u0432\u0441\u0435\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445<\/h3>\n<p>  <\/p>\n<p>\u0427\u0435\u0442\u0432\u0451\u0440\u0442\u044b\u0439 \u0441\u043e\u0432\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u0430\u043f\u0438\u0442\u0430\u043d\u0441\u043a\u0438\u0439, \u043d\u043e \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432\u0430\u0436\u043d\u044b\u0439 \u2013 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0439\u0442\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u0432\u0441\u0435\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445. \u042f \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 Java-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 <em>Linux<\/em>, \u0438 \u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0442 \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u0438\u044f. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445 \u0431\u044b\u0432\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/github.com\/zonkyio\/embedded-postgres\/issues\/32\" rel=\"nofollow\">\u0442\u0430\u043a\u0438\u0435<\/a>), \u0438 \u0432\u0430\u0448 <strong>CI<\/strong>-\u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u043e\u0432\u0438\u0442\u044c \u0438\u0445 \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0441 \u043d\u0438\u043c\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u0441\u044f \u0432\u0430\u0448\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438.<\/p>\n<p>  <\/p>\n<h3 id=\"ispolzuyte-sql-dlya-opisaniya-migraciy-bd\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 SQL \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u0411\u0414<\/h3>\n<p>  <\/p>\n<p>\u041f\u044f\u0442\u043e\u0435: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <strong>plain SQL<\/strong> \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u0432\u0430\u0448\u0435\u0439 \u0411\u0414. \u0417\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0440\u043e xml, yml \u0438 \u043f\u0440\u043e\u0447\u0435\u0435, \u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0440\u043e\u0449\u0435 \u0438 \u0431\u043b\u0438\u0436\u0435 \u043a \u0421\u0423\u0411\u0414, \u043e\u0431\u0449\u0430\u0439\u0442\u0435\u0441\u044c \u0441 \u0431\u0430\u0437\u043e\u0439 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u044b\u0432\u0430\u044e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443\\\u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0411\u0414. \u0412\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0437 xml-\u0444\u0430\u0439\u043b\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0432 psql\\pgAdmin \u2013 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. C <strong>plain SQL<\/strong> \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0432\u044b \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u0435 \u0441\u0435\u0431\u0435 \u043d\u0435\u043c\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;databaseChangeLog         xmlns=&quot;http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog&quot;         xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;         xsi:schemaLocation=&quot;http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog             http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog\/dbchangelog-3.6.xsd&quot;&gt;     &lt;changeSet id=&quot;orders_table_create_2020-05-09&quot; author=&quot;ivan.vakhrushev&quot;&gt;         &lt;createTable tableName=&quot;orders&quot;&gt;             &lt;column name=&quot;id&quot; type=&quot;BIGINT&quot;&gt;                 &lt;constraints nullable=&quot;false&quot; primaryKey=&quot;true&quot;\/&gt;             &lt;\/column&gt;             &lt;column name=&quot;shop_id&quot; type=&quot;BIGINT&quot;&gt;                 &lt;constraints nullable=&quot;false&quot;\/&gt;             &lt;\/column&gt;             &lt;column name=&quot;buyer_id&quot; type=&quot;BIGINT&quot;&gt;                 &lt;constraints nullable=&quot;false&quot;\/&gt;             &lt;\/column&gt;             &lt;column name=&quot;status&quot; type=&quot;VARCHAR(20)&quot;&gt;             &lt;column name=&quot;creation_time&quot; type=&quot;TIMESTAMP&quot;&gt;                 &lt;constraints nullable=&quot;false&quot;\/&gt;             &lt;\/column&gt;             &lt;column name=&quot;update_time&quot; type=&quot;TIMESTAMP&quot;\/&gt;         &lt;\/createTable&gt;     &lt;\/changeSet&gt; &lt;\/databaseChangeLog&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">--liquibase formatted sql --changeset ivan.vakhrushev:orders_table_create_2020-05-09 create table if not exists orders (     id bigint not null primary key,     shop_id bigint not null,     buyer_id bigint not null,     status varchar(20),     creation_time timestamp not null,     update_time timestamp );<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"sledite-za-izmeneniyami-v-yazyke-programmirovaniya-i-subd\">\u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0421\u0423\u0411\u0414<\/h3>\n<p>  <\/p>\n<p>\u0418 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0441 <em>Java 8<\/em> \u043d\u0430 <em>Java 11<\/em> \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441\u0442\u0430\u043b\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0430\u0434\u0430\u0442\u044c \u043f\u0440\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 <a href=\"https:\/\/bugs.openjdk.java.net\/browse\/JDK-8068730\" rel=\"nofollow\">\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 Instant\\LocalDateTime<\/a>. <em>PostgreSQL<\/em> \u0445\u0440\u0430\u043d\u0438\u0442 <em>Timestamp<\/em> \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/10\/datatype-datetime\" rel=\"nofollow\">\u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434<\/a>, \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0441\u0435\u043a\u0430\u044f \u00ab\u043b\u0438\u0448\u043d\u0438\u0435\u00bb \u0437\u043d\u0430\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u0412 Java \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043e \u043d\u0430\u043d\u043e\u0441\u0435\u043a\u0443\u043d\u0434. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u0434\u0430\u043b\u0438 \u0442\u0435 \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432 \u0411\u0414 \u00ab\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439\u00bb \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0435\u0451 \u0432\u0441\u0442\u0430\u0432\u043a\u0438. \u041a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043b\u0435\u0447\u0435\u043d\u0438\u044f, \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0438\u0441\u044c\u044e \u0432 \u0411\u0414 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0442\u0438\u043f\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">Timestamp.valueOf(localDateTime.truncatedTo(ChronoUnit.MICROS)); Timestamp.from(instant.truncatedTo(ChronoUnit.MICROS));<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0441\u0451. \u0421\u043c\u0435\u044e \u043d\u0430\u0434\u0435\u044f\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u043e\u0432\u0435\u0442\u043e\u0432 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c.<br \/>  \u0427\u0438\u0441\u0442\u043e\u0433\u043e \u0432\u0430\u043c \u043a\u043e\u0434\u0430 \u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u0431\u0430\u0433\u043e\u0432.<\/p>\n<\/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\/post\/501454\/\"> https:\/\/habr.com\/ru\/post\/501454\/<\/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\/post\/501454\/\">\n<p>\u0412 2018-\u043c \u0433\u043e\u0434\u0443, \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u0432 <em>Akvelon Inc.<\/em>, \u044f \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043b \u043e\u0434\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u041f\u0435\u0440\u0435\u0434 \u0438\u043d\u0442\u0435\u0440\u0432\u044c\u044e \u043c\u043d\u0435 \u0434\u0430\u043b\u0438 \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0435\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435: \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0442\u0438\u043f\u0443 \u0437\u0430\u043f\u0438\u0441\u043d\u043e\u0439 \u043a\u043d\u0438\u0436\u043a\u0438 \u0438\u043b\u0438 todo-\u0441\u043f\u0438\u0441\u043a\u0430 \u2013 React\\TypeScript, C# \u043d\u0430 \u0431\u044d\u043a\u0435 \u0438 MS SQL Server \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043c\u043e\u0434\u043d\u043e\u0435: \u0441 \u043e\u0431\u0438\u043b\u0438\u0435\u043c unit-\u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 mock\u2019\u0430\u0445, \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432 docker-\u043e\u0431\u0440\u0430\u0437 \u2013 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f. \u0418 \u0443 \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u044b\u043b \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u2013 \u043e\u043d\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. \u0421\u043e\u0432\u0441\u0435\u043c. \u041f\u0430\u0434\u0430\u043b\u043e \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dm\/im\/sb\/dmimsbwf3txk0dgcfmtsvyjrmmu.jpeg\"><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u0438\u043b \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0438\u0437 \u043d\u0438\u0445 \u2013 \u043b\u043e\u0436\u043d\u0430\u044f \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u0414\u0430\u0436\u0435 100% \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u043a\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>  <\/p>\n<p>\u0418 \u0432\u0442\u043e\u0440\u0430\u044f \u2013 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0421\u0423\u0411\u0414, \u0442\u043e \u0432\u044b \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u0418 \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435: \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0421\u0423\u0411\u0414, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0443 \u0432\u0430\u0441 \u0432 production\u2019\u0435. \u0414\u0443\u043c\u0430\u044e, \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u043e\u0434 <em>Oracle<\/em>, \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u044e\u0449\u0438\u0435 \u0441\u0432\u043e\u0438 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 H2\\HSQLDB, \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0433\u0434\u0430 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442, \u0430 production \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 (<em>boolean<\/em>, <em>group by<\/em> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0447\u0443\u0434\u0435\u0441\u0430).<\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441 <em>PostgreSQL<\/em> \u0438 \u043c\u0438\u0433\u0440\u0438\u0440\u0443\u044e \u043d\u0430\u0448\u0438 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0441 10-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0430 11-\u0443\u044e. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 (\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u043e\u043e\u0431\u0449\u0435) \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043d\u044e\u0430\u043d\u0441\u0430\u043c\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/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-303392","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/303392","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=303392"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/303392\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=303392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=303392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=303392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}