{"id":351544,"date":"2024-05-20T21:49:25","date_gmt":"2024-05-20T21:49:25","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=351544"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=351544","title":{"rendered":"<span>Atlas \u2014 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u0430\u043c\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u0411\u0414 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c: \u043d\u0430\u0448 \u043e\u043f\u044b\u0442 \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0435\u0439<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0dc\/c28\/fe5\/0dcc28fe5c238f698928608be58847ef.png\" width=\"1878\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0dc\/c28\/fe5\/0dcc28fe5c238f698928608be58847ef.png\"\/><\/figure>\n<p>\u041e \u0434\u0438\u0432\u043d\u044b\u0439 \u043c\u0438\u0440, Infrastructure as a Code! \u0421 \u043a\u0430\u0436\u0434\u044b\u043c \u0434\u043d\u0451\u043c \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0435\u0442\u0435\u0440\u043e\u0433\u0435\u043d\u043d\u044b\u043c\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u043b\u044e\u0431\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u2014 \u0441\u0432\u043e\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0438 \u043a\u043e\u043c\u0431\u0430\u0439\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u043b\u0438 \u0438 \u043d\u0435 \u0440\u0435\u0448\u0430\u044e\u0442 \u0432\u0441\u0435\u0445 \u0437\u0430\u0434\u0430\u0447, \u0442\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043a \u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0440\u0435\u043c\u044f\u0442\u0441\u044f. \u041f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043c\u043d\u043e\u0433\u043e. \u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u2014 Terraform. \u0427\u0443\u0442\u044c \u043c\u0435\u043d\u0435\u0435 \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u044b \u043d\u0435 \u0442\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 Pulumi \u0438 Crossplane.<\/p>\n<p>\u0412\u0441\u0435 \u0434\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438, \u0447\u0442\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u043c\u0438 Kubernetes \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0446\u0435\u043b\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u043a\u0430\u043b\u0438\u0431\u0440\u0430 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438: Rancher, Deckhouse, OpenShift, Kubespray, Helm, werf, K9s, Komodor.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041d\u0430 \u0441\u0432\u044f\u0437\u0438 \u0412\u0430\u0441\u0438\u043b\u0438\u0439 \u041c\u0430\u0440\u043c\u0435\u0440, DevOps-\u0442\u0438\u043c\u043b\u0438\u0434 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u00ab\u0424\u043b\u0430\u043d\u0442\u00bb. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0431 <a href=\"https:\/\/atlasgo.io\/\">Atlas<\/a> \u2014 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 DevOps-\u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e\u0439. Atlas \u0443\u0432\u0438\u0434\u0435\u043b \u043c\u0438\u0440 \u0432 \u043d\u043e\u044f\u0431\u0440\u0435 2021\u00a0\u0433\u043e\u0434\u0430, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0443 \u043d\u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 3,3\u00a0\u0442\u044b\u0441\u044f\u0447\u0438 \u0437\u0432\u0451\u0437\u0434 \u043d\u0430 GitHub. \u042f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 Go.<\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u0430\u043c\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b DevOps. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Atlas \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0441\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043a\u0430\u043a \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0445\u0435\u043c \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 CI.<\/p>\n<p>Atlas \u0438 \u0435\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 MySQL \u0438 PostgreSQL, \u043d\u043e \u0438 \u0441 MariaDB, TiDB \u0438 CockroachDB, \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 SQLite, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043f\u043e\u0434\u0441\u043f\u043e\u0440\u044c\u0435\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0438 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u0441\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>\u0418\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 Atlas \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c <a href=\"https:\/\/atlasgo.io\/declarative\/diff#diff-policy\">\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c<\/a>: \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c <em>skip destructive<\/em> (\u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u0432\u0441\u044e \u0431\u0430\u0437\u0443 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b) \u0438\u043b\u0438 <em>concurrent_index<\/em> (\u0447\u0442\u043e\u0431\u044b \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u043e, \u0431\u0435\u0437 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446, \u2014 \u044d\u0442\u043e \u043e\u043f\u0446\u0438\u044f, \u043a\u0441\u0442\u0430\u0442\u0438, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430). \u0423\u0434\u043e\u0431\u043d\u043e \u0438 \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0438\u043f\u044b \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0432 <a href=\"https:\/\/atlasgo.io\/atlas-schema\/hcl-types\">HCL<\/a>.<\/p>\n<p>\u0412 Kubernetes \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Atlas \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043d\u043e \u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <a href=\"https:\/\/atlasgo.io\/guides\/deploying\/k8s-init-container\">init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/a> \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0449\u0451 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/atlasgo.io\/guides\/deploying\/k8s-argo\">Argo\u00a0CD<\/a>. \u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0438\u0437 \u0432\u0441\u0435\u0445, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0431\u044a\u0435\u043c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u043c\u0438 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 <a href=\"https:\/\/atlasgo.io\/guides\/migration-tools\/golang-migrate\">\u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/a> \u0438 <a href=\"https:\/\/atlasgo.io\/guides\/migration-tools\/goose-import\">\u0438\u043c\u043f\u043e\u0440\u0442\u0430<\/a>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u0442\u044c <a href=\"https:\/\/atlasgo.io\/guides\/terraform\/named-databases\">\u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Terraform<\/a> \u2014 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u0438\u043c \u043f\u043e\u0434\u0441\u043f\u043e\u0440\u044c\u0435\u043c \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Terraform \u00ab\u043a\u0440\u0443\u0442\u0438\u0442 \u0431\u0430\u0437\u044b \u0432 \u043e\u0431\u043b\u0430\u043a\u0430\u0445\u00bb.<\/p>\n<p>\u041e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c, \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Atlas \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e: \u043d\u0430 \u0445\u043e\u0441\u0442\u0430\u0445 \u2014 \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0432 Kubernetes \u2014 \u043e\u0442 <em>sidecar-, init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/em>, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u0430\u043c\u0438 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/extend-kubernetes\/api-extension\/custom-resources\/\">Custom\u00a0Resources<\/a>) \u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u0430 GitOps \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/atlasgo.io\/guides\/deploying\/k8s-argo\">Argo\u00a0CD<\/a> \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0435\u043f\u0435\u0440\u044c DDL \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. <\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043c<\/h2>\n<p>Atlas \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (\u043a\u0430\u043a \u0432 Terraform) \u2014 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0441\u043e \u0441\u0445\u0435\u043c\u043e\u0439, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432 HCL-, SQL-\u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 ORM (\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c <em>diff<\/em> \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b);<\/p>\n<\/li>\n<li>\n<p>\u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0438\u0445 \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Atlas.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u0441, DevOps-\u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432, \u0434\u043b\u044f \u0432\u043e\u043f\u043b\u043e\u0449\u0435\u043d\u0438\u044f \u043c\u0435\u0447\u0442\u044b <em>World as a Code<\/em> \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Atlas. \u0427\u0442\u043e \u0436, \u043f\u0440\u043e\u0432\u0435\u0434\u0451\u043c \u043f\u043e\u043b\u0435\u0432\u044b\u0435 \u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u0430 \u0445\u043e\u0441\u0442 \u0441\u0430\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442:<\/p>\n<pre><code># curl -sSf https:\/\/atlasgo.sh | sh Install 'atlas-linux-amd64-latest' to '\/usr\/local\/bin\/atlas'? [y\/N] y Downloading https:\/\/release.ariga.io\/atlas\/atlas-linux-amd64-latest   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed 100 69.0M  100 69.0M    0     0  51.5M      0  0:00:01  0:00:01 --:--:-- 51.5M atlas version v0.12.1-972da10-canary https:\/\/github.com\/ariga\/atlas\/releases\/latest Installation successful!<\/code><\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e <em>completion<\/em>:<\/p>\n<pre><code>atlas completion bash > \/etc\/bash_completion.d\/atlas<\/code><\/pre>\n<p>\u0414\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d <em>Compose<\/em> \u0434\u043b\u044f Docker. \u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d:<\/p>\n<pre><code># docker compose version Docker Compose version v2.19.1<\/code><\/pre>\n<h2>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Atlas \u0432 Docker Compose<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 Atlas \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Docker Compose. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0431\u043e\u0442\u044b, \u2014 \u043e\u043d\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 <a href=\"https:\/\/docs.docker.com\/compose\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0410 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 K8s, \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0435 \u043e\u043f\u044b\u0442\u044b \u043d\u0430\u0447\u043d\u0451\u043c \u043d\u0430\u0434 MySQL. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u043d\u0438\u043c\u0435\u043c \u0432 Docker \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"yaml\">version: '3.8'  services:   db:     image: mysql:8.0     command: --default-authentication-plugin=mysql_native_password     restart: always     environment:       MYSQL_ROOT_PASSWORD: groot_password     ports:       - \"3306:3306\" <\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<details class=\"spoiler\">\n<summary>DROP DATABASE IF EXISTS employees\u2026<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"sql\">DROP DATABASE IF EXISTS employees; CREATE DATABASE IF NOT EXISTS employees; USE employees;  SELECT 'CREATING DATABASE STRUCTURE' as 'INFO';  DROP TABLE IF EXISTS dept_emp,                      dept_manager,                      titles,                      salaries,                       employees,                       departments;  \/*!50503 set default_storage_engine = InnoDB *\/; \/*!50503 select CONCAT('storage engine: ', @@default_storage_engine) as INFO *\/;  CREATE TABLE employees (     emp_no      INT             NOT NULL,     birth_date  DATE            NOT NULL,     first_name  VARCHAR(14)     NOT NULL,     last_name   VARCHAR(16)     NOT NULL,     gender      ENUM ('M','F')  NOT NULL,         hire_date   DATE            NOT NULL,     PRIMARY KEY (emp_no) );  CREATE TABLE departments (     dept_no     CHAR(4)         NOT NULL,     dept_name   VARCHAR(40)     NOT NULL,     PRIMARY KEY (dept_no),     UNIQUE  KEY (dept_name) );  CREATE TABLE dept_manager (    emp_no       INT             NOT NULL,    dept_no      CHAR(4)         NOT NULL,    from_date    DATE            NOT NULL,    to_date      DATE            NOT NULL,    FOREIGN KEY (emp_no)  REFERENCES employees (emp_no)    ON DELETE CASCADE,    FOREIGN KEY (dept_no) REFERENCES departments (dept_no) ON DELETE CASCADE,    PRIMARY KEY (emp_no,dept_no) );   CREATE TABLE dept_emp (     emp_no      INT             NOT NULL,     dept_no     CHAR(4)         NOT NULL,     from_date   DATE            NOT NULL,     to_date     DATE            NOT NULL,     FOREIGN KEY (emp_no)  REFERENCES employees   (emp_no)  ON DELETE CASCADE,     FOREIGN KEY (dept_no) REFERENCES departments (dept_no) ON DELETE CASCADE,     PRIMARY KEY (emp_no,dept_no) );  CREATE TABLE titles (     emp_no      INT             NOT NULL,     title       VARCHAR(50)     NOT NULL,     from_date   DATE            NOT NULL,     to_date     DATE,     FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ON DELETE CASCADE,     PRIMARY KEY (emp_no,title, from_date) );   CREATE TABLE salaries (     emp_no      INT             NOT NULL,     salary      INT             NOT NULL,     from_date   DATE            NOT NULL,     to_date     DATE            NOT NULL,     FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ON DELETE CASCADE,     PRIMARY KEY (emp_no, from_date) ); <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0417\u0430\u043b\u044c\u0435\u043c \u044d\u0442\u0443 \u0431\u0430\u0437\u0443 \u0432 \u043d\u0430\u0448 MySQL-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440:<\/p>\n<pre><code># cat db.sql | docker exec -i root-db-1 mysql -pgroot_password mysql: [Warning] Using a password on the command line interface can be insecure. INFO CREATING DATABASE STRUCTURE INFO storage engine: InnoDB <\/code><\/pre>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0448\u0435\u0441\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0447\u0435\u043a \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439:<\/p>\n<pre><code># docker exec -it root-db-1 mysql -pgroot_password -e 'use employees; show tables' mysql: [Warning] Using a password on the command line interface can be insecure. +---------------------+ | Tables_in_employees | +---------------------+ | departments         | | dept_emp            | | dept_manager        | | employees           | | salaries            | | titles              | +---------------------+ <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u044c Atlas \u0432 \u0434\u0435\u043b\u0435:<\/p>\n<details class=\"spoiler\">\n<summary># atlas schema inspect -u &#171;mysql:\/\/root\u2026<\/summary>\n<div class=\"spoiler__content\">\n<pre><code># atlas schema inspect -u \"mysql:\/\/root:groot_password@localhost:3306\/employees\" table \"departments\" {   schema = schema.employees   column \"dept_no\" {     null = false     type = char(4)   }   column \"dept_name\" {     null = false     type = varchar(40)   }   primary_key {     columns = [column.dept_no]   }   index \"dept_name\" {     unique  = true     columns = [column.dept_name]   } } table \"dept_emp\" {   schema = schema.employees   column \"emp_no\" {     null = false     type = int   }   column \"dept_no\" {     null = false     type = char(4)   }   column \"from_date\" {     null = false     type = date   }   column \"to_date\" {     null = false     type = date   }   primary_key {     columns = [column.emp_no, column.dept_no]   }   foreign_key \"dept_emp_ibfk_1\" {     columns     = [column.emp_no]     ref_columns = [table.employees.column.emp_no]     on_update   = NO_ACTION     on_delete   = CASCADE   }   foreign_key \"dept_emp_ibfk_2\" {     columns     = [column.dept_no]     ref_columns = [table.departments.column.dept_no]     on_update   = NO_ACTION     on_delete   = CASCADE   }   index \"dept_no\" {     columns = [column.dept_no]   } } table \"dept_manager\" {   schema = schema.employees   column \"emp_no\" {     null = false     type = int   }   column \"dept_no\" {     null = false     type = char(4)   }   column \"from_date\" {     null = false     type = date   }   column \"to_date\" {     null = false     type = date   }   primary_key {     columns = [column.emp_no, column.dept_no]   }   foreign_key \"dept_manager_ibfk_1\" {     columns     = [column.emp_no]     ref_columns = [table.employees.column.emp_no]     on_update   = NO_ACTION     on_delete   = CASCADE   }   foreign_key \"dept_manager_ibfk_2\" {     columns     = [column.dept_no]     ref_columns = [table.departments.column.dept_no]     on_update   = NO_ACTION     on_delete   = CASCADE   }   index \"dept_no\" {     columns = [column.dept_no]   } } table \"employees\" {   schema = schema.employees   column \"emp_no\" {     null = false     type = int   }   column \"birth_date\" {     null = false     type = date   }   column \"first_name\" {     null = false     type = varchar(14)   }   column \"last_name\" {     null = false     type = varchar(16)   }   column \"gender\" {     null = false     type = enum(\"M\",\"F\")   }   column \"hire_date\" {     null = false     type = date   }   primary_key {     columns = [column.emp_no]   } } table \"salaries\" {   schema = schema.employees   column \"emp_no\" {     null = false     type = int   }   column \"salary\" {     null = false     type = int   }   column \"from_date\" {     null = false     type = date   }   column \"to_date\" {     null = false     type = date   }   primary_key {     columns = [column.emp_no, column.from_date]   }   foreign_key \"salaries_ibfk_1\" {     columns     = [column.emp_no]     ref_columns = [table.employees.column.emp_no]     on_update   = NO_ACTION     on_delete   = CASCADE   } } table \"titles\" {   schema = schema.employees   column \"emp_no\" {     null = false     type = int   }   column \"title\" {     null = false     type = varchar(50)   }   column \"from_date\" {     null = false     type = date   }   column \"to_date\" {     null = true     type = date   }   primary_key {     columns = [column.emp_no, column.title, column.from_date]   }   foreign_key \"titles_ibfk_1\" {     columns     = [column.emp_no]     ref_columns = [table.employees.column.emp_no]     on_update   = NO_ACTION     on_delete   = CASCADE   } } schema \"employees\" {   charset = \"utf8mb4\"   collate = \"utf8mb4_0900_ai_ci\" } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u0438\u043d\u043d\u044b\u043c\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u043e\u0432, \u0438\u043c\u0435\u043d\u0430, \u0444\u0430\u043c\u0438\u043b\u0438\u0438. \u0421\u0440\u0430\u0432\u043d\u0438\u043c \u0444\u0430\u0439\u043b\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .<em>HCL<\/em> \u0441\u043e \u0441\u0445\u0435\u043c\u0430\u043c\u0438 \u2014 \u043d\u043e\u0432\u043e\u0439 \u0438 \u0441\u0442\u0430\u0440\u043e\u0439.<\/p>\n<p>\u0412\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442: \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043a\u043b\u044e\u0447 <code>--dev-url<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u043f\u0443\u0441\u0442\u043e\u0439 dev-\u0431\u0430\u0437\u043e\u0439, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 Atlas \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u0442, \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0438 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c. \u0423\u043a\u0430\u0436\u0435\u043c <code>docker:\/\/mysql\/8\/schema<\/code>\u00a0 \u2014 \u0438 Atlas \u0441\u0430\u043c \u043f\u043e\u0434\u043d\u0438\u043c\u0435\u0442 \u043f\u0443\u0441\u0442\u0443\u044e \u0432\u0440\u0435\u0301\u043c\u0435\u043d\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0432 Docker.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 <em>diff<\/em>:<\/p>\n<pre><code># atlas schema diff -f file:\/\/employees.hcl --to file:\/\/employees_v2.hcl --dev-url docker:\/\/mysql\/8\/schema -- Modify \"departments\" table ALTER TABLE `departments` MODIFY COLUMN `dept_name` varchar(200) NOT NULL; -- Modify \"employees\" table ALTER TABLE `employees` MODIFY COLUMN `first_name` varchar(50) NOT NULL, MODIFY COLUMN `last_name` varchar(50) NOT NULL; <\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 (\u0443\u0436\u0435 \u0432\u0442\u043e\u0440\u0443\u044e) \u043f\u0443\u0441\u0442\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u043f\u043e\u0440\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 <em>localhost<\/em>:<\/p>\n<pre><code># docker compose up -d [+] Running 2\/2  \u2714 Container root-db2-1  Started                                                                                                                                                                           1.1s  \u2714 Container root-db-1   Running # cat db.sql | docker exec -i root-db2-1 mysql -pgroot_password mysql: [Warning] Using a password on the command line interface can be insecure. INFO CREATING DATABASE STRUCTURE INFO storage engine: InnoDB # atlas schema diff -f mysql:\/\/root:groot_password@localhost:3306\/employees --to mysql:\/\/root:groot_password@localhost:3307\/employees --dev-url docker:\/\/mysql\/8\/schema Schemas are synced, no changes to be made. <\/code><\/pre>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043f\u0435\u0440\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043f\u0435\u0440\u0432\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0430\u0439\u043b\u0430 \u0441\u0445\u0435\u043c\u044b:<\/p>\n<pre><code># atlas schema apply -u mysql:\/\/root:groot_password@localhost:3306\/employees --to file:\/\/employees_v2.hcl --dry-run -- Planned Changes: -- Modify \"departments\" table ALTER TABLE `employees`.`departments` MODIFY COLUMN `dept_name` varchar(200) NOT NULL; -- Modify \"employees\" table ALTER TABLE `employees`.`employees` MODIFY COLUMN `first_name` varchar(50) NOT NULL, MODIFY COLUMN `last_name` varchar(50) NOT NULL; # atlas schema apply -u mysql:\/\/root:groot_password@localhost:3306\/employees --to file:\/\/employees_v2.hcl -- Planned Changes: -- Modify \"departments\" table ALTER TABLE `employees`.`departments` MODIFY COLUMN `dept_name` varchar(200) NOT NULL; -- Modify \"employees\" table ALTER TABLE `employees`.`employees` MODIFY COLUMN `first_name` varchar(50) NOT NULL, MODIFY COLUMN `last_name` varchar(50) NOT NULL; \u2714 Apply<\/code><\/pre>\n<p>\u0412\u0442\u043e\u0440\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e:<\/p>\n<pre><code># atlas schema apply -u mysql:\/\/root:groot_password@localhost:3307\/employees --to mysql:\/\/root:groot_password@localhost:3306\/employees --dry-run -- Planned Changes: -- Modify \"departments\" table ALTER TABLE `departments` MODIFY COLUMN `dept_name` varchar(200) NOT NULL; -- Modify \"employees\" table ALTER TABLE `employees` MODIFY COLUMN `first_name` varchar(50) NOT NULL, MODIFY COLUMN `last_name` varchar(50) NOT NULL; # atlas schema apply -u mysql:\/\/root:groot_password@localhost:3307\/employees --to mysql:\/\/root:groot_password@localhost:3306\/employees --auto-approve -- Planned Changes: -- Modify \"departments\" table ALTER TABLE `departments` MODIFY COLUMN `dept_name` varchar(200) NOT NULL; -- Modify \"employees\" table ALTER TABLE `employees` MODIFY COLUMN `first_name` varchar(50) NOT NULL, MODIFY COLUMN `last_name` varchar(50) NOT NULL; <\/code><\/pre>\n<p>\u041a\u043b\u044e\u0447 <code>--auto-approve<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0435\u0437 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a Atlas \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 PostgreSQL. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 <em>compose<\/em>:<\/p>\n<pre><code class=\"yaml\">version: '3.8'  services:   db:     image: postgres     restart: always     environment:       POSTGRES_PASSWORD: cheburek15     ports:       - \"5432:5432\"   db2:     image: postgres     restart: always     environment:       POSTGRES_PASSWORD: cheburek15     ports:       - \"5433:5432\u201d <\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0433\u043e:<\/p>\n<pre><code># docker compose up -d [+] Running 3\/3  \u2714 Network root_default  Created                                                                                                                                                                           0.1s  \u2714 Container root-db2-1  Started                                                                                                                                                                           1.2s  \u2714 Container root-db-1   Started <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 DDL:<\/p>\n<pre><code class=\"sql\">CREATE SCHEMA IF NOT EXISTS cd;  CREATE TABLE cd.facilities (     facid integer NOT NULL PRIMARY KEY,     name character varying(100) NOT NULL,     membercost numeric NOT NULL,     guestcost numeric NOT NULL,     initialoutlay numeric NOT NULL,     monthlymaintenance numeric NOT NULL );  CREATE TABLE cd.members (     memid integer NOT NULL PRIMARY KEY,     surname character varying(200) NOT NULL,     firstname character varying(200) NOT NULL,     address character varying(300) NOT NULL,     zipcode integer NOT NULL,     telephone character varying(20) NOT NULL,     recommendedby integer,     joindate timestamp without time zone NOT NULL ); <\/code><\/pre>\n<p>\u0417\u0430\u043b\u044c\u0451\u043c \u0435\u0433\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u0431\u0430\u0437\u0443:<\/p>\n<pre><code># cat psql1.sql | docker exec -i root-db-1 psql postgresql:\/\/postgres:cheburek15@root-db-1 CREATE SCHEMA CREATE TABLE CREATE TABLE <\/code><\/pre>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0441\u043b\u0435\u0433\u043a\u0430 \u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0439 DDL:<\/p>\n<pre><code class=\"sql\">CREATE SCHEMA IF NOT EXISTS cd;  CREATE TABLE IF NOT EXISTS cd.facilities (     facid integer NOT NULL PRIMARY KEY,     name character varying(100) NOT NULL,     membercost numeric NOT NULL,     guestcost numeric NOT NULL,     initialoutlay numeric NOT NULL,     monthlymaintenance numeric NOT NULL );  CREATE TABLE IF NOT EXISTS cd.members (     memid integer NOT NULL PRIMARY KEY,     surname character varying(200) NOT NULL,     firstname character varying(200) NOT NULL,     address character varying(300) NOT NULL,     zipcode integer NOT NULL,     telephone character varying(20) NOT NULL,     recommendedby integer,     joindate timestamp without time zone NOT NULL,     FOREIGN KEY (recommendedby) REFERENCES cd.members(memid) ON DELETE SET NULL );  CREATE TABLE IF NOT EXISTS cd.bookings (     bookid integer NOT NULL PRIMARY KEY,     facid integer NOT NULL,     memid integer NOT NULL,     starttime timestamp without time zone NOT NULL,     slots integer NOT NULL,         FOREIGN KEY (facid) REFERENCES cd.facilities(facid),         FOREIGN KEY (memid) REFERENCES cd.members(memid) ); <\/code><\/pre>\n<p>\u0417\u0430\u043b\u044c\u0435\u043c \u043d\u0430\u0448 DDL \u0432\u043e \u0432\u0442\u043e\u0440\u0443\u044e \u0431\u0430\u0437\u0443:<\/p>\n<pre><code># cat psql2.sql | docker exec -i root-db2-1 psql postgresql:\/\/postgres:cheburek15@root-db2-1 CREATE SCHEMA CREATE TABLE CREATE TABLE CREATE TABLE <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a \u043f\u0435\u0440\u0432\u043e\u0439. \u0412\u0441\u0451 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u0430\u043a, \u043a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c:<\/p>\n<pre><code># atlas schema apply -u postgresql:\/\/postgres:cheburek15@localhost:5432\/postgres?sslmode=disable --to postgresql:\/\/postgres:cheburek15@localhost:5433\/postgres?sslmode=disable --dry-run -- Planned Changes: -- Modify \"members\" table ALTER TABLE \"cd\".\"members\" ADD CONSTRAINT \"members_recommendedby_fkey\" FOREIGN KEY (\"recommendedby\") REFERENCES \"cd\".\"members\" (\"memid\") ON UPDATE NO ACTION ON DELETE SET NULL; -- Create \"bookings\" table CREATE TABLE \"cd\".\"bookings\" (\"bookid\" integer NOT NULL, \"facid\" integer NOT NULL, \"memid\" integer NOT NULL, \"starttime\" timestamp NOT NULL, \"slots\" integer NOT NULL, PRIMARY KEY (\"bookid\"), CONSTRAINT \"bookings_facid_fkey\" FOREIGN KEY (\"facid\") REFERENCES \"cd\".\"facilities\" (\"facid\") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT \"bookings_memid_fkey\" FOREIGN KEY (\"memid\") REFERENCES \"cd\".\"members\" (\"memid\") ON UPDATE NO ACTION ON DELETE NO ACTION);  # atlas schema apply -u postgresql:\/\/postgres:cheburek15@localhost:5432\/postgres?sslmode=disable --to postgresql:\/\/postgres:cheburek15@localhost:5433\/postgres?sslmode=disable --auto-approve -- Planned Changes: -- Modify \"members\" table ALTER TABLE \"cd\".\"members\" ADD CONSTRAINT \"members_recommendedby_fkey\" FOREIGN KEY (\"recommendedby\") REFERENCES \"cd\".\"members\" (\"memid\") ON UPDATE NO ACTION ON DELETE SET NULL; -- Create \"bookings\" table CREATE TABLE \"cd\".\"bookings\" (\"bookid\" integer NOT NULL, \"facid\" integer NOT NULL, \"memid\" integer NOT NULL, \"starttime\" timestamp NOT NULL, \"slots\" integer NOT NULL, PRIMARY KEY (\"bookid\"), CONSTRAINT \"bookings_facid_fkey\" FOREIGN KEY (\"facid\") REFERENCES \"cd\".\"facilities\" (\"facid\") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT \"bookings_memid_fkey\" FOREIGN KEY (\"memid\") REFERENCES \"cd\".\"members\" (\"memid\") ON UPDATE NO ACTION ON DELETE NO ACTION); <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u2014 \u043f\u043b\u043e\u0445\u043e\u0432\u0430\u0442\u043e \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0431\u0435\u0437 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432. \u0414\u043b\u044f \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044f \u043d\u0430\u043a\u0438\u043d\u0435\u043c \u0438\u0445 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043d\u0430 \u0432\u0442\u043e\u0440\u0443\u044e \u0431\u0430\u0437\u0443:<\/p>\n<details class=\"spoiler\">\n<summary>CREATE INDEX\u2026<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"sql\">CREATE INDEX \"bookings.memid_facid\"   ON cd.bookings   USING btree   (memid, facid);  CREATE INDEX \"bookings.facid_memid\"   ON cd.bookings   USING btree   (facid, memid);  CREATE INDEX \"bookings.facid_starttime\"   ON cd.bookings   USING btree   (facid, starttime);  CREATE INDEX \"bookings.memid_starttime\"   ON cd.bookings   USING btree   (memid, starttime);  CREATE INDEX \"bookings.starttime\"   ON cd.bookings   USING btree   (starttime);  CREATE INDEX \"members.joindate\"   ON cd.members   USING btree   (joindate);  CREATE INDEX \"members.recommendedby\"   ON cd.members   USING btree   (recommendedby);  # cat psql3.sql | docker exec -i root-db2-1 psql postgresql:\/\/postgres:cheburek15@root-db2-1 CREATE INDEX CREATE INDEX CREATE INDEX CREATE INDEX CREATE INDEX CREATE INDEX CREATE INDEX <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043a\u0438\u043d\u0443\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0431\u0430\u0437\u0443, \u0438\u0441\u043f\u044b\u0442\u0430\u0435\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>create_tables<\/code> \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0435\u0437 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432:<\/p>\n<pre><code># atlas migrate diff create_tables --dir \"file:\/\/migrations\" --to \"postgresql:\/\/postgres:cheburek15@localhost:5432\/postgres?sslmode=disable\" --dev-url \"docker:\/\/postgres\/15\/test\"<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f:<\/p>\n<pre><code># ls migrations\/ 20230712165510_create_tables.sql  atlas.sum # cat migrations\/20230712165510_create_tables.sql -- Add new schema named \"cd\" CREATE SCHEMA \"cd\"; -- Create \"facilities\" table CREATE TABLE \"cd\".\"facilities\" (\"facid\" integer NOT NULL, \"name\" character varying(100) NOT NULL, \"membercost\" numeric NOT NULL, \"guestcost\" numeric NOT NULL, \"initialoutlay\" numeric NOT NULL, \"monthlymaintenance\" numeric NOT NULL, PRIMARY KEY (\"facid\")); -- Create \"members\" table CREATE TABLE \"cd\".\"members\" (\"memid\" integer NOT NULL, \"surname\" character varying(200) NOT NULL, \"firstname\" character varying(200) NOT NULL, \"address\" character varying(300) NOT NULL, \"zipcode\" integer NOT NULL, \"telephone\" character varying(20) NOT NULL, \"recommendedby\" integer NULL, \"joindate\" timestamp NOT NULL, PRIMARY KEY (\"memid\"), CONSTRAINT \"members_recommendedby_fkey\" FOREIGN KEY (\"recommendedby\") REFERENCES \"cd\".\"members\" (\"memid\") ON UPDATE NO ACTION ON DELETE SET NULL); -- Create \"bookings\" table CREATE TABLE \"cd\".\"bookings\" (\"bookid\" integer NOT NULL, \"facid\" integer NOT NULL, \"memid\" integer NOT NULL, \"starttime\" timestamp NOT NULL, \"slots\" integer NOT NULL, PRIMARY KEY (\"bookid\"), CONSTRAINT \"bookings_facid_fkey\" FOREIGN KEY (\"facid\") REFERENCES \"cd\".\"facilities\" (\"facid\") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT \"bookings_memid_fkey\" FOREIGN KEY (\"memid\") REFERENCES \"cd\".\"members\" (\"memid\") ON UPDATE NO ACTION ON DELETE NO ACTION); # cat migrations\/atlas.sum h1:TBIl3WYjzvTYokioT+K3FOOlq9LSAzryhjxw5gAGz6U= 20230712165510_create_tables.sql h1:BWXssdgcYxJcYSNOaK7bYlhgB5LsumtrNXiBfkC3HiU= <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>create_indexes<\/code> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0442\u043e\u0440\u0443\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e, \u0443\u0436\u0435 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438:<\/p>\n<pre><code># atlas migrate diff create_indexes --dir \"file:\/\/migrations\" --to \"postgresql:\/\/postgres:cheburek15@localhost:5433\/postgres?sslmode=disable\" --dev-url \"docker:\/\/postgres\/15\/test\"<\/code><\/pre>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code># cat migrations\/20230712165923_create_indexes.sql -- Create index \"bookings.facid_memid\" to table: \"bookings\" CREATE INDEX \"bookings.facid_memid\" ON \"cd\".\"bookings\" (\"facid\", \"memid\"); -- Create index \"bookings.facid_starttime\" to table: \"bookings\" CREATE INDEX \"bookings.facid_starttime\" ON \"cd\".\"bookings\" (\"facid\", \"starttime\"); -- Create index \"bookings.memid_facid\" to table: \"bookings\" CREATE INDEX \"bookings.memid_facid\" ON \"cd\".\"bookings\" (\"memid\", \"facid\"); -- Create index \"bookings.memid_starttime\" to table: \"bookings\" CREATE INDEX \"bookings.memid_starttime\" ON \"cd\".\"bookings\" (\"memid\", \"starttime\"); -- Create index \"bookings.starttime\" to table: \"bookings\" CREATE INDEX \"bookings.starttime\" ON \"cd\".\"bookings\" (\"starttime\"); -- Create index \"members.joindate\" to table: \"members\" CREATE INDEX \"members.joindate\" ON \"cd\".\"members\" (\"joindate\"); -- Create index \"members.recommendedby\" to table: \"members\" CREATE INDEX \"members.recommendedby\" ON \"cd\".\"members\" (\"recommendedby\"); <\/code><\/pre>\n<p>\u0427\u0442\u043e \u0436\u2026 \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e!<\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0438 \u0432\u0438\u0448\u0435\u043d\u043a\u0430 \u043d\u0430 \u0442\u043e\u0440\u0442\u0435. \u0415\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c Atlas \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438<em> migrations<\/em> \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435 \u0432 Docker, \u0442\u043e Atlas \u0441\u043e\u043e\u0431\u0449\u0438\u0442: \u00ab\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445\u00bb. \u041c\u044b \u0436\u0435 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u044b \u0441 \u044d\u0442\u0438\u043c \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u044c\u0441\u044f, \u043d\u0435 \u0442\u0430\u043a \u043b\u0438?<\/p>\n<pre><code># atlas migrate lint --dir file:\/\/migrations --dev-url \"docker:\/\/postgres\/15\/test\" --latest 2 20230712165923_create_indexes.sql: concurrent index violations detected:   L2: Creating index \"bookings.facid_memid\" non-concurrently causes write locks on the \"bookings\" table L4: Creating index \"bookings.facid_starttime\" non-concurrently causes write locks on the \"bookings\" table L6: Creating index \"bookings.memid_facid\" non-concurrently causes write locks on the \"bookings\" table L8: Creating index \"bookings.memid_starttime\" non-concurrently causes write locks on the \"bookings\" table L10: Creating index \"bookings.starttime\" non-concurrently causes write locks on the \"bookings\" table L12: Creating index \"members.joindate\" non-concurrently causes write locks on the \"members\" table L14: Creating index \"members.recommendedby\" non-concurrently causes write locks on the \"members\" table <\/code><\/pre>\n<p>\u041f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0440\u0443\u043a\u0430\u043c\u0438, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <code>CONCURRENTLY<\/code>:<\/p>\n<pre><code>-- Create index \"bookings.facid_memid\" to table: \"bookings\" CREATE INDEX CONCURRENTLY \"bookings.facid_memid\" ON \"cd\".\"bookings\" (\"facid\", \"memid\"); -- Create index \"bookings.facid_starttime\" to table: \"bookings\" CREATE INDEX CONCURRENTLY \"bookings.facid_starttime\" ON \"cd\".\"bookings\" (\"facid\", \"starttime\"); -- Create index \"bookings.memid_facid\" to table: \"bookings\" CREATE INDEX CONCURRENTLY \"bookings.memid_facid\" ON \"cd\".\"bookings\" (\"memid\", \"facid\"); -- Create index \"bookings.memid_starttime\" to table: \"bookings\" CREATE INDEX CONCURRENTLY \"bookings.memid_starttime\" ON \"cd\".\"bookings\" (\"memid\", \"starttime\"); -- Create index \"bookings.starttime\" to table: \"bookings\" CREATE INDEX CONCURRENTLY \"bookings.starttime\" ON \"cd\".\"bookings\" (\"starttime\"); -- Create index \"members.joindate\" to table: \"members\" CREATE INDEX CONCURRENTLY \"members.joindate\" ON \"cd\".\"members\" (\"joindate\"); -- Create index \"members.recommendedby\" to table: \"members\" CREATE INDEX CONCURRENTLY \"members.recommendedby\" ON \"cd\".\"members\" (\"recommendedby\"); <\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043b\u0438\u043d\u0442\u0435\u0440 \u0441\u043d\u043e\u0432\u0430:<\/p>\n<pre><code># atlas migrate lint --dir file:\/\/migrations --dev-url \"docker:\/\/postgres\/15\/test\" --latest 2 atlas.sum: checksum mismatch <\/code><\/pre>\n<p>\u0412\u0441\u0451 \u043a\u0430\u043a \u0443 \u0432\u0437\u0440\u043e\u0441\u043b\u044b\u0445. \u041f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443:<\/p>\n<pre><code># atlas migrate hash [team-alfa] root@demo-gitlab-runner ~ # atlas migrate lint --dir file:\/\/migrations --dev-url \"docker:\/\/postgres\/15\/test\" --latest 2 20230712165923_create_indexes.sql: concurrent index violations detected:  L2: Creating index \"bookings.facid_memid\" non-concurrently causes write locks on the \"bookings\" table L4: Creating index \"bookings.facid_starttime\" non-concurrently causes write locks on the \"bookings\" table L6: Creating index \"bookings.memid_facid\" non-concurrently causes write locks on the \"bookings\" table L8: Creating index \"bookings.memid_starttime\" non-concurrently causes write locks on the \"bookings\" table L10: Creating index \"bookings.starttime\" non-concurrently causes write locks on the \"bookings\" table L12: Creating index \"members.joindate\" non-concurrently causes write locks on the \"members\" table L14: Creating index \"members.recommendedby\" non-concurrently causes write locks on the \"members\" table <\/code><\/pre>\n<p>\u0421\u0442\u0440\u0430\u043d\u043d\u043e\u2026 \u041b\u0438\u043d\u0442\u0435\u0440 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 <code>CONCURRENTLY<\/code>!<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 <a href=\"https:\/\/github.com\/ariga\/atlas\/issues\/1851\">issue<\/a>. \u041e\u0442\u0432\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b \u0432 \u0442\u043e\u0442 \u0436\u0435 \u0434\u0435\u043d\u044c \u2014 \u0430\u0432\u0442\u043e\u0440\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 <a href=\"https:\/\/github.com\/ariga\/atlas\/pull\/1852\">\u043d\u0435\u0434\u043e\u0447\u0435\u0442<\/a>.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0442\u0430\u043a\u0438\u0445 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e <code>CONCURRENTLY<\/code> \u2014 \u044d\u0442\u043e \u043d\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430, \u0430 <em>\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/em> \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f, \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044e\u0449\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0438 \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0436\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u2014 \u044d\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u044b\u0435 \u043b\u0443\u0447\u0448\u0438\u0435 \u0434\u0440\u0443\u0437\u044c\u044f.<\/p>\n<p>\u041c\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b \u0432 \u0431\u0435\u0437\u0443\u043f\u0440\u0435\u0447\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0448\u0438\u0445 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439. \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0438\u0445 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u0431\u0430\u0437\u0435, \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u0431\u0430\u0437\u043e\u0432\u0443\u044e (<code>--baseline 20230712165510<\/code>):<\/p>\n<pre><code># atlas migrate apply --dir \"file:\/\/migrations\" -u \"postgresql:\/\/postgres:cheburek15@localhost:5432\/postgres?sslmode=disable\" --baseline 20230712165510 Migrating to version 20230712165923 from 20230712165510 (1 migrations in total):    -- migrating version 20230712165923     -> CREATE INDEX CONCURRENTLY \"bookings.facid_memid\" ON \"cd\".\"bookings\" (\"facid\", \"memid\");     pq: CREATE INDEX CONCURRENTLY cannot run inside a transaction block    -------------------------   -- 13.541209ms   -- 0 migrations ok (1 with errors)   -- 0 sql statements ok (1 with errors) Error: sql\/migrate: sql\/migrate: execute: executing statement \"CREATE INDEX CONCURRENTLY \\\"bookings.facid_memid\\\" ON \\\"cd\\\".\\\"bookings\\\" (\\\"facid\\\", \\\"memid\\\");\" from version \"20230712165923\": pq: CREATE INDEX CONCURRENTLY cannot run inside a transaction block: sql\/migrate: execute: write revision: pq: current transaction is aborted, commands ignored until end of transaction block <\/code><\/pre>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0448\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u0430. \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e:<\/p>\n<pre><code># atlas migrate apply --dir \"file:\/\/migrations\" -u \"postgresql:\/\/postgres:cheburek15@localhost:5432\/postgres?sslmode=disable\" --baseline 20230712165510 --tx-mode none Migrating to version 20230712165923 from 20230712165510 (1 migrations in total):    -- migrating version 20230712165923     -> CREATE INDEX CONCURRENTLY \"bookings.facid_memid\" ON \"cd\".\"bookings\" (\"facid\", \"memid\");     -> CREATE INDEX CONCURRENTLY \"bookings.facid_starttime\" ON \"cd\".\"bookings\" (\"facid\", \"starttime\");     -> CREATE INDEX CONCURRENTLY \"bookings.memid_facid\" ON \"cd\".\"bookings\" (\"memid\", \"facid\");     -> CREATE INDEX CONCURRENTLY \"bookings.memid_starttime\" ON \"cd\".\"bookings\" (\"memid\", \"starttime\");     -> CREATE INDEX CONCURRENTLY \"bookings.starttime\" ON \"cd\".\"bookings\" (\"starttime\");     -> CREATE INDEX CONCURRENTLY \"members.joindate\" ON \"cd\".\"members\" (\"joindate\");     -> CREATE INDEX CONCURRENTLY \"members.recommendedby\" ON \"cd\".\"members\" (\"recommendedby\");   -- ok (140.526595ms)    -------------------------   -- 148.935351ms   -- 1 migrations   -- 7 sql statements <\/code><\/pre>\n<p>\u0421 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0430\u0437\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0445\u0435\u043c\u0430 \u0438 \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0430 <code>atlas_schema_revisions.atlas_schema_revisions<\/code>, \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code>20230712165923 | create_indexes |\u00a0 \u00a0 2 | \u00a0 \u00a0 \u00a0 7 | \u00a0 \u00a0 7 | 2023-07-12 17:47:38.182729+00 |\u00a0 \u00a0 \u00a0 \u00a0 3720354 | \u00a0 \u00a0 \u00a0 |\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 | WQxGEQSGBr+QCZQB+\/cRZ84Ei8Br2iJ9nbwC9\/k2oW8= | [\"h1:sro8dOuCifHn590KwRbuoLE1w3  8YVON6O2KtEA0pbMQ=\", \"h1:RlXV4ShxPexTzjxAJZTrOLohhHskcmEHg34yCE1UqAc=\", \"h1:3yLYUR5xmF7yOWqA01WQrXZDNSHz7iDMa2ln0ZE23EU=\", \"h1:ZykewJpaiOCFHTEQrJ5mwj1S4uxGjHpTZcb4lG+qTyc=\", \"h1:TL2rPzD9teKkY4RxGU\/\/7PgInoonG8  1+UrPkB1ykRO0=\", \"h1:X1salktLooVmN73SG2G8dUjgrbOysmHah5bs3o2eahk=\", \"h1:+DMH0dQEBDmoGUVXJS0FS9TqXYK6Jd4UbqaMXBd40lQ=\"] | Atlas CLI v0.12.1-972da10-canary<\/code><\/pre>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u0432 Atlas \u043d\u0435 \u0431\u0443\u0434\u0435\u043c. \u041e\u0442\u043c\u0435\u0442\u0438\u043c \u043b\u0438\u0448\u044c, \u0447\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 (\u0435\u0441\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435) \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u2014 \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0432\u0441\u0435\u0445 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u0443\u0442\u0438\u043b\u0438\u0442 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b.<\/p>\n<p>\u0421\u0432\u043e\u0431\u043e\u0434\u0430 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/ariga\/atlas-provider-gorm\">Gorm<\/a>, <a href=\"https:\/\/github.com\/ariga\/atlas-provider-beego\">Beego<\/a> \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432 \u0441\u0445\u0435\u043c \u0434\u043b\u044f Atlas. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/github.com\/ariga\/atlas-go-sdk\">Atlas SDK<\/a>.<\/p>\n<p>\u0427\u0442\u043e \u0436, \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c.<\/p>\n<h2>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Atlas \u0432 Kubernetes<\/h2>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u0432 K8s \u0441\u0442\u0435\u043d\u0434 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043d\u0430\u043a\u0430\u0442\u0438\u043c \u043d\u0430 \u043d\u0438\u0445 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/github.com\/ariga\/atlas-operator\">Atlas Operator<\/a>:<\/p>\n<pre><code>$ helm install atlas-operator oci:\/\/ghcr.io\/ariga\/charts\/atlas-operator -n atlas-operator --create-namespace Pulled: ghcr.io\/ariga\/charts\/atlas-operator:0.2.0 Digest: sha256:15c3d10510acf7ba7ba203a3d6c1ecf4a2d54549031eb74aef6452c33488a5e2 NAME: atlas-operator LAST DEPLOYED: Wed Jul 12 21:46:56 2023 NAMESPACE: atlas-operator STATUS: deployed REVISION: 1 TEST SUITE: None $ kubectl -n atlas-operator get po NAME\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 READY \u00a0 STATUS\u00a0 \u00a0 RESTARTS \u00a0 AGE atlas-operator-77f748578b-rxhbr \u00a0 1\/1 \u00a0 \u00a0 Running \u00a0 0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 38s<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u0443\u0447\u043a\u0443 \u0431\u0430\u0437 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/cloudnative-pg.io\/\">CloudNativePG<\/a> \u0438 <a href=\"https:\/\/www.bitpoke.io\/docs\/mysql-operator\">Bitpoke\u00a0MySQL<\/a> \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 <em>db.yaml<\/em>:<\/p>\n<details class=\"spoiler\">\n<summary>apiVersion: v1\u2026<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"yaml\">apiVersion: v1 kind: Secret metadata: \u00a0\u00a0namespace: databases \u00a0\u00a0name: shop-secret type: kubernetes.io\/basic-auth stringData: \u00a0\u00a0username: shop \u00a0\u00a0password: cheburek15 --- apiVersion: postgresql.cnpg.io\/v1 kind: Cluster metadata: \u00a0\u00a0name: psql1 spec: \u00a0\u00a0instances: 1 \u00a0\u00a0imageName: ghcr.io\/cloudnative-pg\/postgresql:15 \u00a0\u00a0bootstrap: \u00a0\u00a0\u00a0\u00a0initdb: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0database: shop \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0owner: shop \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0secret: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: shop-secret \u00a0\u00a0storage: \u00a0\u00a0\u00a0\u00a0size: 1Gi --- apiVersion: postgresql.cnpg.io\/v1 kind: Cluster metadata: \u00a0\u00a0name: psql2 spec: \u00a0\u00a0instances: 1 \u00a0\u00a0imageName: ghcr.io\/cloudnative-pg\/postgresql:13 \u00a0\u00a0bootstrap: \u00a0\u00a0\u00a0\u00a0initdb: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0database: shop \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0owner: shop \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0secret: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: shop-secret \u00a0\u00a0storage: \u00a0\u00a0\u00a0\u00a0size: 1Gi --- apiVersion: postgresql.cnpg.io\/v1 kind: Cluster metadata: \u00a0\u00a0name: psql3 spec: \u00a0\u00a0instances: 1 \u00a0\u00a0imageName: ghcr.io\/cloudnative-pg\/postgresql:11 \u00a0\u00a0bootstrap: \u00a0\u00a0\u00a0\u00a0initdb: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0database: shop \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0owner: shop \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0secret: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: shop-secret \u00a0\u00a0storage: \u00a0\u00a0\u00a0\u00a0size: 1Gi --- apiVersion: v1 kind: Secret metadata: \u00a0\u00a0name: mysql-secret type: Opaque stringData: \u00a0\u00a0# root password is required to be specified \u00a0\u00a0ROOT_PASSWORD: groot_password \u00a0\u00a0## application credentials that will be created at cluster bootstrap \u00a0\u00a0DATABASE: employees \u00a0\u00a0# USER: \u00a0\u00a0# PASSWORD: --- apiVersion: mysql.presslabs.org\/v1alpha1 kind: MysqlCluster metadata: \u00a0\u00a0name: db1 spec: \u00a0\u00a0replicas: 1 \u00a0\u00a0secretName: mysql-secret \u00a0\u00a0mysqlVersion: \"8.0\" \u00a0\u00a0volumeSpec: \u00a0\u00a0\u00a0\u00a0persistentVolumeClaim: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0accessModes: [\"ReadWriteOnce\"] \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0resources: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0requests: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0storage: 1Gi --- apiVersion: mysql.presslabs.org\/v1alpha1 kind: MysqlCluster metadata: \u00a0\u00a0name: db2 spec: \u00a0\u00a0replicas: 1 \u00a0\u00a0secretName: mysql-secret \u00a0\u00a0mysqlVersion: \"5.7\" \u00a0\u00a0volumeSpec: \u00a0\u00a0\u00a0\u00a0persistentVolumeClaim: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0accessModes: [\"ReadWriteOnce\"] \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0resources: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0requests: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0storage: 1Gi ---<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c <em>ns<\/em> \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0444\u0430\u0439\u043b <em>db.yaml<\/em>:<\/p>\n<pre><code>$ kubectl create ns databases namespace\/databases created $ kubectl -n databases apply -f db.yaml secret\/shop-secret created cluster.postgresql.cnpg.io\/psql1 created cluster.postgresql.cnpg.io\/psql2 created cluster.postgresql.cnpg.io\/psql3 created secret\/mysql-secret created mysqlcluster.mysql.presslabs.org\/mysql1 created mysqlcluster.mysql.presslabs.org\/mysql2 created<\/code><\/pre>\n<p>\u0412\u043e\u0441\u0435\u043c\u044c\u0434\u0435\u0441\u044f\u0442 \u0441\u0435\u043a\u0443\u043d\u0434\u00a0 \u2014 \u0438 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/p>\n<pre><code>$ kubectl -n databases get po NAME\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 READY \u00a0 STATUS\u00a0 \u00a0 RESTARTS \u00a0 AGE db1-mysql-0 \u00a0 4\/4 \u00a0 \u00a0 Running \u00a0 0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 81s db2-mysql-0 \u00a0 4\/4 \u00a0 \u00a0 Running \u00a0 0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 81s psql1-1 \u00a0 \u00a0 \u00a0 1\/1 \u00a0 \u00a0 Running \u00a0 0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 60s psql2-1 \u00a0 \u00a0 \u00a0 1\/1 \u00a0 \u00a0 Running \u00a0 0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 61s psql3-1 \u00a0 \u00a0 \u00a0 1\/1 \u00a0 \u00a0 Running \u00a0 0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 60s<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0434\u0432\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u043e\u0440\u0442\u044f\u043d\u043a\u0438, \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0438\u0445 \u2014 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u00ab\u043c\u0443\u0441\u044c\u00bb:<\/p>\n<details class=\"spoiler\">\n<summary>apiVersion: v1\u2026<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"yaml\">--- apiVersion: v1 kind: Secret metadata: \u00a0\u00a0name: mysql1-creds type: Opaque stringData: \u00a0\u00a0url: \"mysql:\/\/root:groot_password@db1-mysql.databases:3306\/employees\" --- apiVersion: v1 kind: Secret metadata: \u00a0\u00a0name: mysql2-creds type: Opaque stringData: \u00a0\u00a0url: \"mysql:\/\/root:groot_password@db2-mysql.databases:3306\/employees\" --- apiVersion: v1 kind: ConfigMap metadata: \u00a0\u00a0name: migrationdir-mysql data: \u00a0\u00a020230717152110_create_tables.sql: | \u00a0\u00a0\u00a0\u00a0-- Create \"employees\" table \u00a0\u00a0\u00a0\u00a0CREATE TABLE employees (emp_no int NOT NULL, birth_date date NOT NULL, first_name varchar(14) NOT NULL, last_name varchar(16) NOT NULL, gender enum('M','F') NOT NULL, hire_date date NOT NULL, PRIMARY KEY (emp_no)) CHARSET utf8mb4; \u00a0\u00a0\u00a0\u00a0-- Create \"departments\" table \u00a0\u00a0\u00a0\u00a0CREATE TABLE departments (dept_no char(4) NOT NULL, dept_name varchar(40) NOT NULL, PRIMARY KEY (dept_no), UNIQUE INDEX dept_name (dept_name)) CHARSET utf8mb4; \u00a0\u00a0\u00a0\u00a0-- Create \"dept_manager\" table  \u00a0\u00a0\u00a0CREATE TABLE dept_manager (emp_no int NOT NULL, dept_no char(4) NOT NULL, from_date date NOT NULL, to_date date NOT NULL, PRIMARY KEY (emp_no, dept_no), INDEX dept_no (dept_no), CONSTRAINT dept_manager_ibfk_1 FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT dept_manager_ibfk_2 FOREIGN KEY (dept_no) REFERENCES departments (dept_no) ON UPDATE NO ACTION ON DELETE CASCADE) CHARSET utf8mb4; \u00a0\u00a0\u00a0\u00a0-- Create \"salaries\" table \u00a0\u00a0\u00a0\u00a0CREATE TABLE salaries (emp_no int NOT NULL, salary int NOT NULL, from_date date NOT NULL, to_date date NOT NULL, PRIMARY KEY (emp_no, from_date), CONSTRAINT salaries_ibfk_1 FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ON UPDATE NO ACTION ON DELETE CASCADE) CHARSET utf8mb4; \u00a0\u00a0\u00a0\u00a0-- Create \"titles\" table \u00a0\u00a0\u00a0\u00a0CREATE TABLE titles (emp_no int NOT NULL, title varchar(50) NOT NULL, from_date date NOT NULL, to_date date NULL, PRIMARY KEY (emp_no, title, from_date), CONSTRAINT titles_ibfk_1 FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ON UPDATE NO ACTION ON DELETE CASCADE) CHARSET utf8mb4; \u00a0\u00a0\u00a0\u00a0-- Create \"dept_emp\" table \u00a0\u00a0\u00a0\u00a0CREATE TABLE dept_emp (emp_no int NOT NULL, dept_no char(4) NOT NULL, from_date date NOT NULL, to_date date NOT NULL, PRIMARY KEY (emp_no, dept_no), INDEX dept_no (dept_no), CONSTRAINT dept_emp_ibfk_1 FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ON UPDATE NO ACTION ON DELETE CASCADE, CONSTRAINT dept_emp_ibfk_2 FOREIGN KEY (dept_no) REFERENCES departments (dept_no) ON UPDATE NO ACTION ON DELETE CASCADE) CHARSET utf8mb4; \u00a0\u00a020230717152222_change_lengths.sql: | \u00a0\u00a0\u00a0\u00a0-- Modify \"departments\" table \u00a0\u00a0\u00a0\u00a0ALTER TABLE departments MODIFY COLUMN dept_name varchar(100) NOT NULL; \u00a0\u00a0\u00a0\u00a0-- Modify \"employees\" table \u00a0\u00a0\u00a0\u00a0ALTER TABLE employees MODIFY COLUMN first_name varchar(50) NOT NULL, MODIFY COLUMN last_name varchar(50) NOT NULL; \u00a0\u00a0atlas.sum: | \u00a0\u00a0\u00a0\u00a0h1:FfpuPZJBiN0hYk3K9vIDQfvpbN90jnDVXR53+8YtrBw= \u00a0\u00a0\u00a0\u00a020230717152110_create_tables.sql h1:CLp9rnUH4jHwWkpAiCScuDtUzYrXbSnJtxI8Mh8ntjQ= \u00a0\u00a0\u00a0\u00a020230717152222_change_lengths.sql h1:T0Hi658Y7ZsVhaGSD6mhIyFTgURYFpmEf83Yl9Nd4oA= --- apiVersion: db.atlasgo.io\/v1alpha1 kind: AtlasMigration metadata: \u00a0\u00a0name: atlasmigration-mysql1 spec: \u00a0\u00a0urlFrom: \u00a0\u00a0\u00a0\u00a0secretKeyRef: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0key: url \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: mysql1-creds \u00a0\u00a0dir: \u00a0\u00a0\u00a0\u00a0configMapRef: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: migrationdir-mysql --- apiVersion: db.atlasgo.io\/v1alpha1 kind: AtlasMigration metadata: \u00a0\u00a0name: atlasmigration-mysql2 spec: \u00a0\u00a0urlFrom: \u00a0\u00a0\u00a0\u00a0secretKeyRef: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0key: url \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: mysql2-creds \u00a0\u00a0dir: \u00a0\u00a0\u00a0\u00a0configMapRef: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0name: migrationdir-mysql <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0441 URL, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0436\u0443\u0442 Atlas\u2019\u0443, \u043a\u0443\u0434\u0430 \u0438\u0434\u0442\u0438 \u0438 \u043a\u0430\u043a (\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c <em>namespace<\/em>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0436\u0438\u0432\u0451\u0442 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d), \u043e\u0431\u0449\u0438\u0439 <em>configmap<\/em> \u0441 \u043d\u0430\u0448\u0435\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u0438 \u0435\u0451 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 <em>custom resource <\/em>AtlasMigration, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0432\u0435\u0434\u0451\u0442 \u0432\u0441\u0451 \u0432\u043e\u0435\u0434\u0438\u043d\u043e \u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0438\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043d\u0430\u0448 YAML-\u0444\u0430\u0439\u043b:<\/p>\n<pre><code>$ kubectl -n databases apply -f migrations-mysql.yaml secret\/mysql1-creds created secret\/mysql2-creds created configmap\/migrationdir-mysql created atlasmigration.db.atlasgo.io\/atlasmigration-mysql1 created atlasmigration.db.atlasgo.io\/atlasmigration-mysql2 created<\/code><\/pre>\n<p>\u0412\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>get<\/code> \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u043c:<\/p>\n<pre><code>$ kubectl -n databases get atlasmigrations.db.atlasgo.io NAME\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 AGE atlasmigration-mysql1 \u00a0 2m59s atlasmigration-mysql2 \u00a0 2m59s<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0425\u043c\u2026 \u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e <code>Reason:\u00a0Applied<\/code>, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0439 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442:<\/p>\n<details class=\"spoiler\">\n<summary>$ kubectl -n databases describe\u2026<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>$ kubectl -n databases describe atlasmigrations.db.atlasgo.io atlasmigration-mysql1 Name: \u00a0 \u00a0 \u00a0 \u00a0 atlasmigration-mysql1 Namespace:\u00a0 \u00a0 databases Labels: \u00a0 \u00a0 \u00a0 &lt;none> Annotations:\u00a0 &lt;none> API Version:\u00a0 db.atlasgo.io\/v1alpha1 Kind: \u00a0 \u00a0 \u00a0 \u00a0 AtlasMigration Metadata: \u00a0\u00a0Creation Timestamp:\u00a0 2023-07-17T16:01:56Z \u00a0\u00a0Generation:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1 \u00a0\u00a0Managed Fields: \u00a0\u00a0\u00a0\u00a0API Version:\u00a0 db.atlasgo.io\/v1alpha1 \u00a0\u00a0\u00a0\u00a0Fields Type:\u00a0 FieldsV1 \u00a0\u00a0\u00a0\u00a0fieldsV1: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:metadata: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:annotations: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:kubectl.kubernetes.io\/last-applied-configuration: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:spec: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:dir: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:configMapRef: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:urlFrom: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:secretKeyRef: \u00a0\u00a0\u00a0\u00a0Manager:\u00a0 \u00a0 \u00a0 kubectl-client-side-apply \u00a0\u00a0\u00a0\u00a0Operation:\u00a0 \u00a0 Update \u00a0\u00a0\u00a0\u00a0Time: \u00a0 \u00a0 \u00a0 \u00a0 2023-07-17T16:01:56Z \u00a0\u00a0\u00a0\u00a0API Version:\u00a0 db.atlasgo.io\/v1alpha1 \u00a0\u00a0\u00a0\u00a0Fields Type:\u00a0 FieldsV1 \u00a0\u00a0\u00a0\u00a0fieldsV1: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:status: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:conditions: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:lastApplied: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:lastAppliedVersion: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0f:observed_hash: \u00a0\u00a0\u00a0\u00a0Manager: \u00a0 \u00a0 \u00a0 \u00a0 manager \u00a0\u00a0\u00a0\u00a0Operation: \u00a0 \u00a0 \u00a0 Update \u00a0\u00a0\u00a0\u00a0Subresource: \u00a0 \u00a0 status \u00a0\u00a0\u00a0\u00a0Time:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 2023-07-17T16:15:19Z \u00a0\u00a0Resource Version:\u00a0 53849536 \u00a0\u00a0UID: \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 43b829b4-c36d-4761-adff-aa304457c21a Spec: \u00a0\u00a0Dir: \u00a0\u00a0\u00a0\u00a0Config Map Ref: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Name:\u00a0 migrationdir-mysql \u00a0\u00a0URL From: \u00a0\u00a0\u00a0\u00a0Secret Key Ref: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Key: \u00a0 url \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Name:\u00a0 mysql1-creds Status: \u00a0\u00a0Conditions: \u00a0\u00a0\u00a0\u00a0Last Transition Time:\u00a0 2023-07-17T16:15:18Z \u00a0\u00a0\u00a0\u00a0Message: \u00a0\u00a0\u00a0\u00a0Reason:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Applied \u00a0\u00a0\u00a0\u00a0Status:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 True \u00a0\u00a0\u00a0\u00a0Type:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Ready \u00a0\u00a0Last Applied:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1689610518 \u00a0\u00a0Last Applied Version:\u00a0 \u00a0 20230717152222 \u00a0\u00a0observed_hash: \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 c7911afe9a6f0918b5cdebfc41f85baf6d9bc08cd272aed87b25b3541be71a35 Events:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &lt;none><\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u0432\u0441\u0435 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0432\u0435\u0438\u0432\u0430\u044e\u0442\u0441\u044f:<\/p>\n<pre><code>$ kubectl -n databases exec -i db1-mysql-0 -cmysql -- mysql -uroot -pgroot_password employees -e'show create table employees;' mysql: [Warning] Using a password on the command line interface can be insecure. TableCreate Table employeesCREATE TABLE `employees` (\\n  `emp_no` int NOT NULL,\\n  `birth_date` date NOT NULL,\\n  `first_name` varchar(50) NOT NULL,\\n  `last_name` varchar(50) NOT NULL,\\n  `gender` enum('M','F') NOT NULL,\\n  `hire_date` date NOT NULL,\\n  PRIMARY KEY (`emp_no`)\\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci $ kubectl -n databases exec -i db2-mysql-0 -cmysql -- mysql -uroot -pgroot_password employees -e'show create table employees;' mysql: [Warning] Using a password on the command line interface can be insecure. TableCreate Table employeesCREATE TABLE `employees` (\\n  `emp_no` int(11) NOT NULL,\\n  `birth_date` date NOT NULL,\\n  `first_name` varchar(50) NOT NULL,\\n  `last_name` varchar(50) NOT NULL,\\n  `gender` enum('M','F') NOT NULL,\\n  `hire_date` date NOT NULL,\\n  PRIMARY KEY (`emp_no`)\\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4<\/code><\/pre>\n<p>\u0421 PostgreSQL \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e:<\/p>\n<details class=\"spoiler\">\n<summary>apiVersion: v1\u2026<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"yaml\">--- apiVersion: v1 kind: Secret metadata:   name: psql1-creds type: Opaque stringData:   url: \"postgres:\/\/shop:cheburek15@psql1-rw:5432\/shop?sslmode=disable\" --- apiVersion: v1 kind: Secret metadata:   name: psql2-creds type: Opaque stringData:   url: \"postgres:\/\/shop:cheburek15@psql2-rw:5432\/shop?sslmode=disable\" --- apiVersion: v1 kind: Secret metadata:   name: psql3-creds type: Opaque stringData:   url: \"postgres:\/\/shop:cheburek15@psql3-rw:5432\/shop?sslmode=disable\" --- apiVersion: v1 kind: ConfigMap metadata:   name: migrationdir-psql data:   20230712165510_create_tables.sql: |     -- Add new schema named \"cd\"     CREATE SCHEMA \"cd\";     -- Create \"facilities\" table     CREATE TABLE \"cd\".\"facilities\" (\"facid\" integer NOT NULL, \"name\" character varying(100) NOT NULL, \"membercost\" numeric NOT NULL, \"guestcost\" numeric NOT NULL, \"initialoutlay\" numeric NOT NULL, \"monthlymaintenance\" numeric NOT NULL, PRIMARY KEY (\"facid\"));     -- Create \"members\" table     CREATE TABLE \"cd\".\"members\" (\"memid\" integer NOT NULL, \"surname\" character varying(200) NOT NULL, \"firstname\" character varying(200) NOT NULL, \"address\" character varying(300) NOT NULL, \"zipcode\" integer NOT NULL, \"telephone\" character varying(20) NOT NULL, \"recommendedby\" integer NULL, \"joindate\" timestamp NOT NULL, PRIMARY KEY (\"memid\"), CONSTRAINT \"members_recommendedby_fkey\" FOREIGN KEY (\"recommendedby\") REFERENCES \"cd\".\"members\" (\"memid\") ON UPDATE NO ACTION ON DELETE SET NULL);     -- Create \"bookings\" table     CREATE TABLE \"cd\".\"bookings\" (\"bookid\" integer NOT NULL, \"facid\" integer NOT NULL, \"memid\" integer NOT NULL, \"starttime\" timestamp NOT NULL, \"slots\" integer NOT NULL, PRIMARY KEY (\"bookid\"), CONSTRAINT \"bookings_facid_fkey\" FOREIGN KEY (\"facid\") REFERENCES \"cd\".\"facilities\" (\"facid\") ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT \"bookings_memid_fkey\" FOREIGN KEY (\"memid\") REFERENCES \"cd\".\"members\" (\"memid\") ON UPDATE NO ACTION ON DELETE NO ACTION);     -- Create \"employees\" table   20230712165923_create_indexes.sql: |     -- Create index \"bookings.facid_memid\" to table: \"bookings\" CREATE INDEX CONCURRENTLY \"bookings.facid_memid\" ON \"cd\".\"bookings\" (\"facid\", \"memid\"); -- Create index \"bookings.facid_starttime\" to table: \"bookings\" CREATE INDEX CONCURRENTLY \"bookings.facid_starttime\" ON \"cd\".\"bookings\" (\"facid\", \"starttime\"); -- Create index \"bookings.memid_facid\" to table: \"bookings\" CREATE INDEX CONCURRENTLY \"bookings.memid_facid\" ON \"cd\".\"bookings\" (\"memid\", \"facid\"); -- Create index \"bookings.memid_starttime\" to table: \"bookings\" CREATE INDEX CONCURRENTLY \"bookings.memid_starttime\" ON \"cd\".\"bookings\" (\"memid\", \"starttime\"); -- Create index \"bookings.starttime\" to table: \"bookings\" CREATE INDEX CONCURRENTLY \"bookings.starttime\" ON \"cd\".\"bookings\" (\"starttime\"); -- Create index \"members.joindate\" to table: \"members\" CREATE INDEX CONCURRENTLY \"members.joindate\" ON \"cd\".\"members\" (\"joindate\"); -- Create index \"members.recommendedby\" to table: \"members\" CREATE INDEX CONCURRENTLY \"members.recommendedby\" ON \"cd\".\"members\" (\"recommendedby\");  (\"recommendedby\");   atlas.sum: |     h1:xTbw3AxHRH3YSW7dOGteMxvcigM3f\/Y7pdkwwScmbGM=     20230712165510_create_tables.sql h1:BWXssdgcYxJcYSNOaK7bYlhgB5LsumtrNXiBfkC3HiU=     20230712165923_create_indexes.sql h1:WQxGEQSGBr+QCZQB+\/cRZ84Ei8Br2iJ9nbwC9\/k2oW8= --- apiVersion: db.atlasgo.io\/v1alpha1 kind: AtlasMigration metadata:   name: atlasmigration-psql1 spec:   urlFrom:     secretKeyRef:       key: url       name: psql1-creds   dir:     configMapRef:       name: \"migrationdir-psql\" --- apiVersion: db.atlasgo.io\/v1alpha1 kind: AtlasMigration metadata:   name: atlasmigration-psql2 spec:   urlFrom:     secretKeyRef:       key: url       name: psql2-creds   dir:     configMapRef:       name: \"migrationdir-psql\" --- apiVersion: db.atlasgo.io\/v1alpha1 kind: AtlasMigration metadata:   name: atlasmigration-psql3 spec:   urlFrom:     secretKeyRef:       key: url       name: psql3-creds   dir:     configMapRef:       name: \"migrationdir-psql\" <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0443\u0442\u0438 \u043d\u0430\u0441 \u0436\u0434\u0430\u043b \u043e\u0434\u0438\u043d \u043a\u0443\u0440\u044c\u0451\u0437\u043d\u044b\u0439 Pull Request \u2014 \u0432 \u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/ariga\/atlas-operator\/pull\/63\">issue tracker<\/a> \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0443, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438 \u0435\u0451. \u042d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u043c\u0435\u0448\u0430\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c <a href=\"https:\/\/github.com\/ariga\/atlas\/issues\/1870\">\u043d\u043e\u0432\u044b\u0439 issue<\/a> \u043e \u043d\u0430\u0448\u0435\u0439 \u043d\u0435\u0443\u0434\u0430\u0432\u0448\u0435\u0439\u0441\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>CONCURRENTLY<\/code> \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0435 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430:<\/p>\n<pre><code>Status:   Conditions:     Last Transition Time:  2023-07-17T17:18:37Z     Message:               sql\/migrate: sql\/migrate: execute: executing statement \"CREATE INDEX CONCURRENTLY \\\"bookings.facid_memid\\\" ON \\\"cd\\\".\\\"bookings\\\" (\\\"facid\\\", \\\"memid\\\");\" from version \"20230712165923\": pq: CREATE INDEX CONCURRENTLY cannot run inside a transaction block: sql\/migrate: execute: write revision: pq: current transaction is aborted, commands ignored until end of transaction block     Reason:                Reconciling     Status:                False     Type:                  Ready   Last Applied:            0<\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043c\u044b \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043d\u0430\u0448\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u0418\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u041d\u043e \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0438 \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435:<\/p>\n<blockquote>\n<p>A file directive should be separated by two newlines from the first statement&#8217;s comment.<\/p>\n<\/blockquote>\n<p>\u0412\u0441\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c, \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u0435\u0445\u0430\u043b\u0438 \u2014 \u0438 \u043d\u0430 \u044d\u0442\u043e\u043c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u0442\u043e\u0438\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 Atlas \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f\u0445 \u0432 \u0434\u0432\u0443\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u043d\u0435\u043f\u043b\u043e\u0445, \u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0443\u0440\u0430\u0445. \u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u0445 DDL;<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445;<\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a\u043e\u0432\u044b \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442.\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 (\u0438 \u0434\u0430\u0436\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438) \u043a\u043e\u043d\u0442\u0443\u0440\u0430\u043c\u0438-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u2014 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0438 \u0436\u0438\u0432\u043e\u0439 \u043a\u0435\u0439\u0441.<\/p>\n<p>\u041d\u0430\u0443\u0447\u0438\u0432\u0448\u0438\u0441\u044c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Atlas, \u043c\u043e\u0436\u043d\u043e \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0438 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u2014 \u0430, \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e! \u2014 \u0442\u0438\u0440\u0430\u0436\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0434\u0430, \u043d\u043e \u0438 DDL: \u043e\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0434\u043e production. \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043a\u0430\u043a \u0441\u0430\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0445 \u0441\u0443\u043c\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439), \u0442\u0430\u043a \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439. \u041d\u0435\u0442 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h3>P.\u202fS.<\/h3>\n<p>\u0427\u0438\u0442\u0430\u0439\u0442\u0435 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0431\u043b\u043e\u0433\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/flant\/articles\/500850\/\">\u0411\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u043d\u0430\u0442\u044c \u044d\u0442\u043e \u043e \u0431\u0430\u0437\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/flant\/articles\/737204\/\">\u041a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e etcd \u043c\u0435\u0436\u0434\u0443 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u043c\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u043c\u0438 Kubernetes \u0438 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435\u0432<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/flant\/articles\/461149\/\">\u0411\u0435\u0441\u043f\u0440\u043e\u0441\u0442\u043e\u0439\u043d\u0430\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f MongoDB \u0432 Kubernetes<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/flant\/articles\/431500\/\">\u0411\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 Kubernetes (\u043e\u0431\u0437\u043e\u0440 \u0438 \u0432\u0438\u0434\u0435\u043e \u0434\u043e\u043a\u043b\u0430\u0434\u0430)<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/753122\/\"> https:\/\/habr.com\/ru\/articles\/753122\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041e \u0434\u0438\u0432\u043d\u044b\u0439 \u043c\u0438\u0440, Infrastructure as a Code! \u0421 \u043a\u0430\u0436\u0434\u044b\u043c \u0434\u043d\u0451\u043c \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0435\u0442\u0435\u0440\u043e\u0433\u0435\u043d\u043d\u044b\u043c\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u043b\u044e\u0431\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u2014 \u0441\u0432\u043e\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0438 \u043a\u043e\u043c\u0431\u0430\u0439\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u043b\u0438 \u0438 \u043d\u0435 \u0440\u0435\u0448\u0430\u044e\u0442 \u0432\u0441\u0435\u0445 \u0437\u0430\u0434\u0430\u0447, \u0442\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043a \u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0440\u0435\u043c\u044f\u0442\u0441\u044f. \u041f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043c\u043d\u043e\u0433\u043e. \u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u2014 Terraform. \u0427\u0443\u0442\u044c \u043c\u0435\u043d\u0435\u0435 \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u044b \u043d\u0435 \u0442\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 Pulumi \u0438 Crossplane.<\/p>\n<p>\u0412\u0441\u0435 \u0434\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438, \u0447\u0442\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u043c\u0438 Kubernetes \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0446\u0435\u043b\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u043a\u0430\u043b\u0438\u0431\u0440\u0430 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438: Rancher, Deckhouse, OpenShift, Kubespray, Helm, werf, K9s, Komodor.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041d\u0430 \u0441\u0432\u044f\u0437\u0438 \u0412\u0430\u0441\u0438\u043b\u0438\u0439 \u041c\u0430\u0440\u043c\u0435\u0440, DevOps-\u0442\u0438\u043c\u043b\u0438\u0434 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u00ab\u0424\u043b\u0430\u043d\u0442\u00bb. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0431 <a href=\"https:\/\/atlasgo.io\/\">Atlas<\/a> \u2014 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 DevOps-\u0438\u043d\u0436\u0435\u043d\u0435\u0440\u0430 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e\u0439. Atlas \u0443\u0432\u0438\u0434\u0435\u043b \u043c\u0438\u0440 \u0432 \u043d\u043e\u044f\u0431\u0440\u0435 2021\u00a0\u0433\u043e\u0434\u0430, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0443 \u043d\u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 3,3\u00a0\u0442\u044b\u0441\u044f\u0447\u0438 \u0437\u0432\u0451\u0437\u0434 \u043d\u0430 GitHub. \u042f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 Go.<\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u0430\u043c\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b DevOps. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Atlas \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0441\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043a\u0430\u043a \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0445\u0435\u043c \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 CI.<\/p>\n<p>Atlas \u0438 \u0435\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 MySQL \u0438 PostgreSQL, \u043d\u043e \u0438 \u0441 MariaDB, TiDB \u0438 CockroachDB, \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 SQLite, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043f\u043e\u0434\u0441\u043f\u043e\u0440\u044c\u0435\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0438 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u0441\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>\u0418\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 Atlas \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c <a href=\"https:\/\/atlasgo.io\/declarative\/diff#diff-policy\">\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c<\/a>: \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c <em>skip destructive<\/em> (\u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u0432\u0441\u044e \u0431\u0430\u0437\u0443 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b) \u0438\u043b\u0438 <em>concurrent_index<\/em> (\u0447\u0442\u043e\u0431\u044b \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u043e, \u0431\u0435\u0437 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446, \u2014 \u044d\u0442\u043e \u043e\u043f\u0446\u0438\u044f, \u043a\u0441\u0442\u0430\u0442\u0438, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430). \u0423\u0434\u043e\u0431\u043d\u043e \u0438 \u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0438\u043f\u044b \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0432 <a href=\"https:\/\/atlasgo.io\/atlas-schema\/hcl-types\">HCL<\/a>.<\/p>\n<p>\u0412 Kubernetes \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Atlas \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043d\u043e \u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <a href=\"https:\/\/atlasgo.io\/guides\/deploying\/k8s-init-container\">init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/a> \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0449\u0451 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/atlasgo.io\/guides\/deploying\/k8s-argo\">Argo\u00a0CD<\/a>. \u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0438\u0437 \u0432\u0441\u0435\u0445, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0431\u044a\u0435\u043c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u044b\u043c\u0438 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 <a href=\"https:\/\/atlasgo.io\/guides\/migration-tools\/golang-migrate\">\u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/a> \u0438 <a href=\"https:\/\/atlasgo.io\/guides\/migration-tools\/goose-import\">\u0438\u043c\u043f\u043e\u0440\u0442\u0430<\/a>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u0442\u044c <a href=\"https:\/\/atlasgo.io\/guides\/terraform\/named-databases\">\u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Terraform<\/a> \u2014 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u0438\u043c \u043f\u043e\u0434\u0441\u043f\u043e\u0440\u044c\u0435\u043c \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Terraform \u00ab\u043a\u0440\u0443\u0442\u0438\u0442 \u0431\u0430\u0437\u044b \u0432 \u043e\u0431\u043b\u0430\u043a\u0430\u0445\u00bb.<\/p>\n<p>\u041e\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0432\u043e\u043c, \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Atlas \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e: \u043d\u0430 \u0445\u043e\u0441\u0442\u0430\u0445 \u2014 \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0432 Kubernetes \u2014 \u043e\u0442 <em>sidecar-, init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/em>, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u0430\u043c\u0438 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/extend-kubernetes\/api-extension\/custom-resources\/\">Custom\u00a0Resources<\/a>) \u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u0430 GitOps \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/atlasgo.io\/guides\/deploying\/k8s-argo\">Argo\u00a0CD<\/a> \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0435\u043f\u0435\u0440\u044c DDL \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. <\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043c<\/h2>\n<p>Atlas \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (\u043a\u0430\u043a \u0432 Terraform) \u2014 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0441\u043e \u0441\u0445\u0435\u043c\u043e\u0439, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432 HCL-, SQL-\u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 ORM (\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c <em>diff<\/em> \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b);<\/p>\n<\/li>\n<li>\n<p>\u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0438\u0445 \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Atlas.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u0441, DevOps-\u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432, \u0434\u043b\u044f \u0432\u043e\u043f\u043b\u043e\u0449\u0435\u043d\u0438\u044f \u043c\u0435\u0447\u0442\u044b <em>World as a Code<\/em> \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Atlas. \u0427\u0442\u043e \u0436, \u043f\u0440\u043e\u0432\u0435\u0434\u0451\u043c \u043f\u043e\u043b\u0435\u0432\u044b\u0435 \u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u0430 \u0445\u043e\u0441\u0442 \u0441\u0430\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442:<\/p>\n<pre><code># curl -sSf https:\/\/atlasgo.sh | sh Install 'atlas-linux-amd64-latest' to '\/usr\/local\/bin\/atlas'? [y\/N] y Downloading https:\/\/release.ariga.io\/atlas\/atlas-linux-amd64-latest   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed 100 69.0M  100 69.0M    0     0  51.5M      0  0:00:01  0:00:01 --:--:-- 51.5M atlas version v0.12.1-972da10-canary https:\/\/github.com\/ariga\/atlas\/releases\/latest Installation successful!<\/code><\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e <em>completion<\/em>:<\/p>\n<pre><code>atlas completion bash > \/etc\/bash_completion.d\/atlas<\/code><\/pre>\n<p>\u0414\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d <em>Compose<\/em> \u0434\u043b\u044f Docker. \u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d:<\/p>\n<pre><code># docker compose version Docker Compose version v2.19.1<\/code><\/pre>\n<h2>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Atlas \u0432 Docker Compose<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 Atlas \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Docker Compose. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0431\u043e\u0442\u044b, \u2014 \u043e\u043d\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 <a href=\"https:\/\/docs.docker.com\/compose\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0410 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 K8s, \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0435 \u043e\u043f\u044b\u0442\u044b \u043d\u0430\u0447\u043d\u0451\u043c \u043d\u0430\u0434 MySQL. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u043d\u0438\u043c\u0435\u043c \u0432 Docker \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"yaml\">version: '3.8'  services:   db:     image: mysql:8.0     command: --default-authentication-plugin=mysql_native_password     restart: always     environment:       MYSQL_ROOT_PASSWORD: groot_password     ports:       - \"3306:3306\" <\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<details class=\"spoiler\">\n<summary>DROP DATABASE IF EXISTS employees\u2026<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"sql\">DROP DATABASE IF EXISTS employees; CREATE DATABASE IF NOT EXISTS employees; USE employees;  SELECT 'CREATING DATABASE STRUCTURE' as 'INFO';  DROP TABLE IF EXISTS dept_emp,                      dept_manager,                      titles,                      salaries,                       employees,                       departments;  \/*!50503 set default_storage_engine = InnoDB *\/; \/*!50503 select CONCAT('storage engine: ', @@default_storage_engine) as INFO *\/;  CREATE TABLE employees (     emp_no      INT             NOT NULL,     birth_date  DATE            NOT NULL,     first_name  VARCHAR(14)     NOT NULL,     last_name   VARCHAR(16)     NOT NULL,     gender      ENUM ('M','F')  NOT NULL,         hire_date   DATE            NOT NULL,     PRIMARY KEY (emp_no) );  CREATE TABLE departments (     dept_no     CHAR(4)         NOT NULL,     dept_name   VARCHAR(40)     NOT NULL,     PRIMARY KEY (dept_no),     UNIQUE  KEY (dept_name) );  CREATE TABLE dept_manager (    emp_no       INT             NOT NULL,    dept_no      CHAR(4)         NOT NULL,    from_date    DATE            NOT NULL,    to_date      DATE            NOT NULL,    FOREIGN KEY (emp_no)  REFERENCES employees (emp_no)    ON DELETE CASCADE,    FOREIGN KEY (dept_no) REFERENCES departments (dept_no) ON DELETE CASCADE,    PRIMARY KEY (emp_no,dept_no) );   CREATE TABLE dept_emp (     emp_no      INT             NOT NULL,     dept_no     CHAR(4)         NOT NULL,     from_date   DATE            NOT NULL,     to_date     DATE            NOT NULL,     FOREIGN KEY (emp_no)  REFERENCES employees   (emp_no)  ON DELETE CASCADE,     FOREIGN KEY (dept_no) REFERENCES departments (dept_no) ON DELETE CASCADE,     PRIMARY KEY (emp_no,dept_no) );  CREATE TABLE titles (     emp_no      INT             NOT NULL,     title       VARCHAR(50)     NOT NULL,     from_date   DATE            NOT NULL,     to_date     DATE,     FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ON DELETE CASCADE,     PRIMARY KEY (emp_no,title, from_date) );   CREATE TABLE salaries (     emp_no      INT             NOT NULL,     salary      INT             NOT NULL,     from_date   DATE            NOT NULL,     to_date     DATE            NOT NULL,     FOREIGN KEY (emp_no) REFERENCES employees (emp_no) ON DELETE CASCADE,     PRIMARY KEY (emp_no, from_date) ); <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0417\u0430\u043b\u044c\u0435\u043c \u044d\u0442\u0443 \u0431\u0430\u0437\u0443 \u0432 \u043d\u0430\u0448 MySQL-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440:<\/p>\n<pre><code># cat db.sql | docker exec -i root-db-1 mysql -pgroot_password mysql: [Warning] Using a password on the command line interface can be insecure. INFO CREATING DATABASE STRUCTURE INFO storage engine: InnoDB <\/code><\/pre>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0448\u0435\u0441\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0447\u0435\u043a \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439:<\/p>\n<pre><code># docker exec -it root-db-1 mysql -pgroot_password -e 'use employees; show tables' mysql: [Warning] Using a password on the command line interface can be insecure. +---------------------+ | Tables_in_employees | +---------------------+ | departments         | | dept_emp            | | dept_manager        | | employees           | | salaries            | | titles              | +---------------------+ <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u044c Atlas \u0432 \u0434\u0435\u043b\u0435:<\/p>\n<details class=\"spoiler\">\n<summary># atlas schema inspect -u &#171;mysql:\/\/root\u2026<\/summary>\n<div class=\"spoiler__content\">\n<pre><code># atlas schema inspect -u \"mysql:\/\/root:groot_password@localhost:3306\/employees\" table \"departments\" {   schema = schema.employees   column \"dept_no\" {     null = false     type = char(4)   }   column \"dept_name\" {     null = false     type = varchar(40)   }   primary_key {     columns = [column.dept_no]   }   index \"dept_name\" {     unique  = true     columns = [column.dept_name]   } } table \"dept_emp\" {   schema = schema.employees   column \"emp_no\" {     null = false     type = int   }   column \"dept_no\" {     null = false     type = char(4)   }   column \"from_date\" {     null = false     type = date   }   column \"to_date\" {     null = false     type = date   }   primary_key {     columns = [column.emp_no, column.dept_no]   }   foreign_key \"dept_emp_ibfk_1\" {     columns     = [column.emp_no]     ref_columns = [table.employees.column.emp_no]     on_update   = NO_ACTION     on_delete   = CASCADE   }   foreign_key \"dept_emp_ibfk_2\" {     columns     = [column.dept_no]     ref_columns = [table.departments.column.dept_no]     on_update   = NO_ACTION     on_delete   = CASCADE   }   index \"dept_no\" {     columns = [column.dept_no]   } } table \"dept_manager\" {   schema = schema.employees   column \"emp_no\" {     null = false     type = int   }   column \"dept_no\" {     null = false     type = char(4)   }   column \"from_date\" {     null = false     type = date   }   column \"to_date\" {     null = false     type = date   }   primary_key {     columns = [column.emp_no, column.dept_no]   }   foreign_key \"dept_manager_ibfk_1\" {     columns     = [column.emp_no]     ref_columns = [table.employees.column.emp_no]     on_update   = NO_ACTION     on_delete   = CASCADE   }   foreign_key \"dept_manager_ibfk_2\" {     columns     = [column.dept_no]     ref_columns = [table.departments.column.dept_no]     on_update   = NO_ACTION     on_delete   = CASCADE   }   index \"dept_no\" {     columns = [column.dept_no]   } } table \"employees\" {   schema = schema.employees   column \"emp_no\" {     null = false     type = int   } <\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\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-351544","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/351544","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=351544"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/351544\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=351544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=351544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=351544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}