{"id":323008,"date":"2021-05-12T21:00:40","date_gmt":"2021-05-12T21:00:40","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=323008"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=323008","title":{"rendered":"\u041a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Liquibase?"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/3yKP\/\"><strong>\u00ab\u042d\u043a\u0441\u043f\u0440\u0435\u0441\u0441-\u043a\u0443\u0440\u0441 \u043f\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u043c\u0438 (DBVC)\u00bb.<\/strong><\/a><\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3d5\/353\/628\/3d5353628fd7784a90668460f917a5e2.png\" width=\"780\" height=\"439\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p><a href=\"http:\/\/www.liquibase.org\/\"><u>Liquibase<\/u><\/a> \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/www.liquibase.org\/documentation\/sql_format.html\"><u>SQL<\/u><\/a> (\u0438\u043b\u0438 <a href=\"https:\/\/www.liquibase.org\/documentation\/xml_format.html\"><u>XML<\/u><\/a>) \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u042d\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a git.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Liquibase. \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<\/p>\n<p>1. \u041f\u0430\u0439\u043f\u043b\u0430\u0439\u043d Jenkins&nbsp;<\/p>\n<p>2. Shell-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/p>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043d\u0438 \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u043e\u0439 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 Liquibase, \u0442.\u0435. XML \u0438 SQL. \u042f \u0432\u044b\u0431\u0440\u0430\u043b SQL, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 XML \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043d\u0430\u043c\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f SQL. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u043e\u0442 \u0436\u0435 SQL-\u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f Liquibase.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u044f \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u044d\u0442\u0438 \u0448\u0430\u0433\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 Postgre, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0435 \u0436\u0435 \u0448\u0430\u0433\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u0430\u043a\u0436\u0435 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e <a href=\"https:\/\/medium.com\/@xameeramir\/how-to-install-automated-database-deployment-tool-liquibase-3c21f442698f\"><u>\u043d\u0430 \u0432\u0430\u0448\u0435\u043c <\/u><\/a><u>\u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 <\/u><a href=\"https:\/\/medium.com\/@xameeramir\/how-to-install-automated-database-deployment-tool-liquibase-3c21f442698f\"><u>\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d Liquibase <\/u><\/a>.<\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0448\u0430\u0433\u0438:<\/p>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b changelog (\u0436\u0443\u0440\u043d\u0430\u043b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439)<\/strong><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c XML-\u0444\u0430\u0439\u043b \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <a href=\"https:\/\/www.liquibase.org\/documentation\/xml_format.html\"><u>liquibase-changelog.xml<\/u><\/a> (\u0438\u043c\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c!) \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt; &lt;databaseChangeLog xmlns=\"http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:schemaLocation=\"http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog\/dbchangelog-3.1.xsd\"&gt; &lt;include file=\"&lt;path to changeset SQL file&gt;\/&lt;changeset file name&gt;.sql&gt;\" relativeToChangelogFile=\"true\"\/&gt; ...more &lt;include&gt; tags goes here... &lt;\/databaseChangeLog&gt;<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u0435\u0433 <code>include<\/code> \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 XML. \u041a\u0430\u0436\u0434\u044b\u0439 \u0444\u0430\u0439\u043b SQL changeset (\u043d\u0430\u0431\u043e\u0440 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f Liquibase, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 changelog (\u0436\u0443\u0440\u043d\u0430\u043b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439).<\/p>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 (changeset) SQL<\/strong><\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0444\u0430\u0439\u043b\u044b SQL changeset \u0432 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u0432\u0430\u043c\u0438 \u043c\u0435\u0441\u0442\u043e. \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 <a href=\"https:\/\/www.liquibase.org\/documentation\/sql_format.html\"><u>SQL<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 Liquibase, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<pre><code class=\"sql\">--liquibase formatted sql --changeset &lt;author name&gt;:&lt;a unique identifier for the SQL changeset&gt; &lt;SQL statements go here&gt; &lt;SQL statements go here&gt; --rollback &lt;rollback SQL statements&gt; --rollback &lt;rollback SQL statements&gt;<\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"sql\">--liquibase formatted sql --changeset xameeramir:create-test-table CREATE TABLE IF NOT EXISTS testTable( columnName1 VARCHAR (355) ); --rollback DROP TABLE --rollback testTable<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0444\u0430\u0439\u043b SQL changeset \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0444\u0430\u0439\u043b\u0430 XML changelog.<\/p>\n<p><strong>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f SQL changeset \u0432 XML-\u0444\u0430\u0439\u043b\u0435 changelog&nbsp;<\/strong><\/p>\n<p>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0444\u0430\u0439\u043b SQL changeset \u0432 \u0444\u0430\u0439\u043b changelog, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435, \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0442\u0435\u0433\u0430\u043c\u0438 XML:<\/p>\n<pre><code class=\"sql\">&lt;include file=\u201d&lt;path to SQL changeset file&gt;\/&lt;changeset file name&gt;.sql\u201d relativeToChangelogFile=\"true\" \/&gt;<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e SQL changesets \u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u0445 \u0432 \u0444\u0430\u0439\u043b\u0435 changelog, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p><strong>\u0422\u0440\u0438\u0433\u0433\u0435\u0440 \u0432 Liquibase \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/strong><\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u043d\u0438\u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"xml\">liquibase --changeLogFile=&lt;path to changelog file&gt;\/&lt;liquibase changelog file name&gt;.xml --username=&lt;database username&gt; --password=&lt;database password&gt; --classpath=&lt;path to the liquibase installation&gt;\/postgresql-42.2.5.jar --url=jdbc:postgresql:\/\/&lt;database url&gt;\/&lt;database name&gt; update<\/code><\/pre>\n<p>Classpath (\u043f\u0443\u0442\u044c \u043a \u043a\u043b\u0430\u0441\u0441\u0430\u043c) &#8212; \u044d\u0442\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440 JDBC, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0432 <a href=\"https:\/\/medium.com\/@xameeramir\/how-to-install-automated-database-deployment-tool-liquibase-3c21f442698f\"><u>\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438<\/u><\/a>. Postgresql-42.2.5.jar &#8212; \u044d\u0442\u043e JDBC-\u0434\u0440\u0430\u0439\u0432\u0435\u0440, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f <strong>Postgres<\/strong>, \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u0443 \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u043d\u0430 \u044d\u0442\u0438\u0445 \u044d\u0442\u0430\u043f\u0430\u0445.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u0432\u044b\u0448\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 \u0438\u043b\u0438 \u0432 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0435 CI\/CD \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p><strong>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f CI\/CD<\/strong><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 &#8212; \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043b\u0438\u0431\u043e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e shell-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043b\u0438\u0431\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e shell-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0438\u043b\u0438 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 CI\/CD.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f CI\/CD, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 Liquibase, <em>\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0442\u0440\u0438\u0433\u0433\u0435\u0440 (trigger) Liquibase, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435<\/em>, \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c git push \u0432 \u0432\u0435\u0442\u043a\u0443 DEVELOP (\u0438\u043b\u0438 \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e).<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 liquibase-changelog.xml. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 ~\/ \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 include, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u043c\u0438 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f changeset SQL. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 CI\/CD:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0444\u0430\u0439\u043b SQL changeset \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u0435\u0442\u043a\u0438 DEVELOP<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u0435 \u0432\u0435\u0442\u043a\u0443 feature \u0441 \u0432\u0435\u0442\u043a\u043e\u0439 DEVELOP.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f CI\/CD, \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 DEVELOP, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 Liquibase \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>Liquibase \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b (\u043b\u044e\u0431\u044b\u0435 \u0443\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e).<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e shell-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/strong><\/p>\n<p>\u0412 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043e\u0434\u043d\u0430 \u0438 \u0442\u0430 \u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0442\u0440\u0438\u0433\u0433\u0435\u0440 Liquibase. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0438\u0445 changeset (\u043d\u0430\u0431\u043e\u0440\u044b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439) Liquibase \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u043a\u0430\u043a shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0443\u0437\u043d\u0430\u044e\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443? \u041e\u0442\u0432\u0435\u0442 \u043f\u0440\u043e\u0441\u0442:<\/p>\n<ul>\n<li>\n<p>Shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430\u0445 cron.<\/p>\n<\/li>\n<li>\n<p>Shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043f\u0440\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u044b\u0431\u043e\u0440 \u0437\u0430 \u0432\u0430\u043c\u0438!<\/p>\n<hr>\n<blockquote>\n<p>\u0423\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 <a href=\"https:\/\/otus.pw\/3yKP\/\"><strong>\u044d\u043a\u0441\u043f\u0440\u0435\u0441\u0441-\u043a\u0443\u0440\u0441\u0435 \u043f\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u043c\u0438 (DBVC)<\/strong><\/a><\/p>\n<\/blockquote>\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\/company\/otus\/blog\/557008\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/557008\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p>\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/3yKP\/\"><strong>\u00ab\u042d\u043a\u0441\u043f\u0440\u0435\u0441\u0441-\u043a\u0443\u0440\u0441 \u043f\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u043c\u0438 (DBVC)\u00bb.<\/strong><\/a><\/p>\n<\/blockquote>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p><a href=\"http:\/\/www.liquibase.org\/\"><u>Liquibase<\/u><\/a> \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/www.liquibase.org\/documentation\/sql_format.html\"><u>SQL<\/u><\/a> (\u0438\u043b\u0438 <a href=\"https:\/\/www.liquibase.org\/documentation\/xml_format.html\"><u>XML<\/u><\/a>) \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u042d\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a git.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Liquibase. \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<\/p>\n<p>1. \u041f\u0430\u0439\u043f\u043b\u0430\u0439\u043d Jenkins&nbsp;<\/p>\n<p>2. Shell-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/p>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043d\u0438 \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u043e\u0439 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 Liquibase, \u0442.\u0435. XML \u0438 SQL. \u042f \u0432\u044b\u0431\u0440\u0430\u043b SQL, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 XML \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043d\u0430\u043c\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f SQL. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u043e\u0442 \u0436\u0435 SQL-\u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f Liquibase.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u044f \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u044d\u0442\u0438 \u0448\u0430\u0433\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 Postgre, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0435 \u0436\u0435 \u0448\u0430\u0433\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u0430\u043a\u0436\u0435 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e <a href=\"https:\/\/medium.com\/@xameeramir\/how-to-install-automated-database-deployment-tool-liquibase-3c21f442698f\"><u>\u043d\u0430 \u0432\u0430\u0448\u0435\u043c <\/u><\/a><u>\u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 <\/u><a href=\"https:\/\/medium.com\/@xameeramir\/how-to-install-automated-database-deployment-tool-liquibase-3c21f442698f\"><u>\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d Liquibase <\/u><\/a>.<\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0448\u0430\u0433\u0438:<\/p>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b changelog (\u0436\u0443\u0440\u043d\u0430\u043b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439)<\/strong><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c XML-\u0444\u0430\u0439\u043b \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <a href=\"https:\/\/www.liquibase.org\/documentation\/xml_format.html\"><u>liquibase-changelog.xml<\/u><\/a> (\u0438\u043c\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c!) \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt; &lt;databaseChangeLog xmlns=\"http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:schemaLocation=\"http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog\/dbchangelog-3.1.xsd\"&gt; &lt;include file=\"&lt;path to changeset SQL file&gt;\/&lt;changeset file name&gt;.sql&gt;\" relativeToChangelogFile=\"true\"\/&gt; ...more &lt;include&gt; tags goes here... &lt;\/databaseChangeLog&gt;<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u0435\u0433 <code>include<\/code> \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 XML. \u041a\u0430\u0436\u0434\u044b\u0439 \u0444\u0430\u0439\u043b SQL changeset (\u043d\u0430\u0431\u043e\u0440 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f Liquibase, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 changelog (\u0436\u0443\u0440\u043d\u0430\u043b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439).<\/p>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 (changeset) SQL<\/strong><\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0444\u0430\u0439\u043b\u044b SQL changeset \u0432 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u0432\u0430\u043c\u0438 \u043c\u0435\u0441\u0442\u043e. \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 <a href=\"https:\/\/www.liquibase.org\/documentation\/sql_format.html\"><u>SQL<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 Liquibase, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<pre><code class=\"sql\">--liquibase formatted sql --changeset &lt;author name&gt;:&lt;a unique identifier for the SQL changeset&gt; &lt;SQL statements go here&gt; &lt;SQL statements go here&gt; --rollback &lt;rollback SQL statements&gt; --rollback &lt;rollback SQL statements&gt;<\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"sql\">--liquibase formatted sql --changeset xameeramir:create-test-table CREATE TABLE IF NOT EXISTS testTable( columnName1 VARCHAR (355) ); --rollback DROP TABLE --rollback testTable<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0444\u0430\u0439\u043b SQL changeset \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0444\u0430\u0439\u043b\u0430 XML changelog.<\/p>\n<p><strong>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f SQL changeset \u0432 XML-\u0444\u0430\u0439\u043b\u0435 changelog&nbsp;<\/strong><\/p>\n<p>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0444\u0430\u0439\u043b SQL changeset \u0432 \u0444\u0430\u0439\u043b changelog, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435, \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0442\u0435\u0433\u0430\u043c\u0438 XML:<\/p>\n<pre><code class=\"sql\">&lt;include file=\u201d&lt;path to SQL changeset file&gt;\/&lt;changeset file name&gt;.sql\u201d relativeToChangelogFile=\"true\" \/&gt;<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e SQL changesets \u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u0445 \u0432 \u0444\u0430\u0439\u043b\u0435 changelog, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p><strong>\u0422\u0440\u0438\u0433\u0433\u0435\u0440 \u0432 Liquibase \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/strong><\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u043d\u0438\u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"xml\">liquibase --changeLogFile=&lt;path to changelog file&gt;\/&lt;liquibase changelog file name&gt;.xml --username=&lt;database username&gt; --password=&lt;database password&gt; --classpath=&lt;path to the liquibase installation&gt;\/postgresql-42.2.5.jar --url=jdbc:postgresql:\/\/&lt;database url&gt;\/&lt;database name&gt; update<\/code><\/pre>\n<p>Classpath (\u043f\u0443\u0442\u044c \u043a \u043a\u043b\u0430\u0441\u0441\u0430\u043c) &#8212; \u044d\u0442\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440 JDBC, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0432 <a href=\"https:\/\/medium.com\/@xameeramir\/how-to-install-automated-database-deployment-tool-liquibase-3c21f442698f\"><u>\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438<\/u><\/a>. Postgresql-42.2.5.jar &#8212; \u044d\u0442\u043e JDBC-\u0434\u0440\u0430\u0439\u0432\u0435\u0440, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f <strong>Postgres<\/strong>, \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u0443 \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u043d\u0430 \u044d\u0442\u0438\u0445 \u044d\u0442\u0430\u043f\u0430\u0445.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u0432\u044b\u0448\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 \u0438\u043b\u0438 \u0432 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0435 CI\/CD \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p><strong>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f CI\/CD<\/strong><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 &#8212; \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043b\u0438\u0431\u043e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e shell-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043b\u0438\u0431\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e shell-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0438\u043b\u0438 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 CI\/CD.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f CI\/CD, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 Liquibase, <em>\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0442\u0440\u0438\u0433\u0433\u0435\u0440 (trigger) Liquibase, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435<\/em>, \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c git push \u0432 \u0432\u0435\u0442\u043a\u0443 DEVELOP (\u0438\u043b\u0438 \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e).<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 liquibase-changelog.xml. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 ~\/ \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 include, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u043c\u0438 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f changeset SQL. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 CI\/CD:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0444\u0430\u0439\u043b SQL changeset \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u0435\u0442\u043a\u0438 DEVELOP<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u0435 \u0432\u0435\u0442\u043a\u0443 feature \u0441 \u0432\u0435\u0442\u043a\u043e\u0439 DEVELOP.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f CI\/CD, \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 DEVELOP, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 Liquibase \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>Liquibase \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b (\u043b\u044e\u0431\u044b\u0435 \u0443\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e).<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e shell-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/strong><\/p>\n<p>\u0412 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043e\u0434\u043d\u0430 \u0438 \u0442\u0430 \u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0442\u0440\u0438\u0433\u0433\u0435\u0440 Liquibase. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0438\u0445 changeset (\u043d\u0430\u0431\u043e\u0440\u044b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439) Liquibase \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u043a\u0430\u043a shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0443\u0437\u043d\u0430\u044e\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443? \u041e\u0442\u0432\u0435\u0442 \u043f\u0440\u043e\u0441\u0442:<\/p>\n<ul>\n<li>\n<p>Shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430\u0445 cron.<\/p>\n<\/li>\n<li>\n<p>Shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043f\u0440\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u044b\u0431\u043e\u0440 \u0437\u0430 \u0432\u0430\u043c\u0438!<\/p>\n<hr>\n<blockquote>\n<p>\u0423\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 <a href=\"https:\/\/otus.pw\/3yKP\/\"><strong>\u044d\u043a\u0441\u043f\u0440\u0435\u0441\u0441-\u043a\u0443\u0440\u0441\u0435 \u043f\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u043c\u0438 (DBVC)<\/strong><\/a><\/p>\n<\/blockquote>\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\/company\/otus\/blog\/557008\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/557008\/<\/a><br \/><\/br><\/br><\/hr>\n<\/div>\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-323008","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323008","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=323008"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323008\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}