{"id":82041,"date":"2026-09-16T12:03:58","date_gmt":"2026-09-16T06:33:58","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=82041"},"modified":"2026-09-29T12:17:47","modified_gmt":"2026-09-29T06:47:47","slug":"enforcing-and-automating-database-script-execution-before-application-startup","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/","title":{"rendered":"Enforcing and Automating Database Script Execution Before Application Startup"},"content":{"rendered":"<h2><strong>The Problem<\/strong><\/h2>\n<p>Every team eventually hits the same failure mode: a new build goes out, the application starts, and it immediately breaks because a required schema change wasn&#8217;t applied first. Maybe someone forgot to run the SQL script. Maybe it ran against the wrong environment. Maybe it ran after the app already tried to query a column that doesn&#8217;t exist yet.<\/p>\n<p>The fix isn&#8217;t &#8220;remind people to run the script.&#8221; The fix is removing the human step entirely \u2014 making schema changes a mandatory, ordered, tracked part of the deployment pipeline, so the application literally cannot start against a database that isn&#8217;t in the expected state.<\/p>\n<p>There are two broad ways to get there: let the application enforce it at boot, or let the pipeline enforce it before deploy. The two dominant tools \u2014 Flyway and Liquibase \u2014 map cleanly onto this split, though Liquibase can actually do either.<\/p>\n<h2>Option 1: Flyway \u2014 Migrations Run at Application Startup<\/h2>\n<p>Flyway is the simpler of the two tools by design. You keep versioned SQL files (<span style=\"color: #ff0000;\">V1__create_users.sql, V2__add_email_index.sql,<\/span> etc.) inside the application repo. When the Spring Boot app starts, Flyway&#8217;s auto-configuration wakes up before the rest of the context loads, checks a <span style=\"color: #ff0000;\">flyway_schema_history<\/span> table to see which migrations have already run, and applies anything new \u2014 in strict numeric order. If a migration fails, the app refuses to finish starting.<\/p>\n<p><strong>Why this enforces the rule automatically<\/strong>: there is no separate step to forget. The migration is the startup sequence. No Jenkins stage, no manual script run, no possibility of the app and schema drifting out of sync, because they&#8217;re deployed as one atomic unit \u2014 the same JAR that contains the code also contains the migrations.<\/p>\n<p><strong>The tradeoff<\/strong>: every ECS task launch checks the history table before serving traffic, and rollback isn&#8217;t automatic \u2014 Flyway&#8217;s philosophy is &#8220;roll forward,&#8221; so undoing a bad migration means writing a new migration that reverses it, not invoking a built-in rollback command (that&#8217;s a paid Flyway Teams feature).<\/p>\n<h2>Option 2: Liquibase \u2014 Auto-Config Mode (Same Model as Flyway)<\/h2>\n<p>Liquibase, when used through Spring Boot&#8217;s auto-configuration, behaves identically to Flyway in terms of where enforcement happens: at application boot, before the app is considered &#8220;up.&#8221; The difference is format \u2014 changesets are written in XML, YAML, JSON, or SQL, and tracked in <span style=\"color: #ff0000;\">DATABASECHANGELOG \/ DATABASECHANGELOGLOCK<\/span> tables instead of Flyway&#8217;s single history table.<\/p>\n<p>The meaningful advantage here is <strong>built-in rollback<\/strong>. Liquibase changesets can define an explicit rollback block, and <span style=\"color: #ff0000;\">liquibase rollback<\/span> is a free, first-class command \u2014 no forward-fix script required. If your team wants DBAs to be able to reverse a change without a developer writing new code, this is the deciding factor over Flyway.<\/p>\n<h2>Option 3: Liquibase \u2014 Standalone CLI Mode (Pipeline-Enforced)<\/h2>\n<p>This is where Liquibase diverges from Flyway entirely. Instead of running inside the application&#8217;s boot sequence, Liquibase can run as its own step \u2014 invoked from Jenkins, a DBA-controlled job, or any CI system \u2014 completely decoupled from the app&#8217;s lifecycle.<\/p>\n<p>This is the right model when:<\/p>\n<ul>\n<li>The service isn&#8217;t Java\/Spring, so there&#8217;s no natural &#8220;startup hook&#8221; to attach to.<\/li>\n<li>A central platform\/DBA team needs to control when schema changes land, independent of when a given microservice happens to deploy.<\/li>\n<li>Migrations need to run once against a shared database, not once per ECS task (avoiding N tasks racing to apply the same migration on scale-up).<\/li>\n<\/ul>\n<p>Here, enforcement isn&#8217;t &#8220;the app won&#8217;t boot without it&#8221; \u2014 it&#8217;s &#8220;t<strong>he pipeline won&#8217;t proceed to deploy without it<\/strong>.&#8221; The Jenkins stage that runs Liquibase becomes a hard gate: if the changeset fails or the changelog lock can&#8217;t be acquired, the deployment stage never fires.<\/p>\n<h2>Option 4: Pipeline-Driven Raw SQL \/ Separate DB-Change Repository<\/h2>\n<p>For teams that have already decoupled schema changes from application code \u2014 SQL files living in their own repo (e.g. a <span style=\"color: #ff0000;\">db-changes repo<\/span>, organized by ticket ID), rather than inside each service&#8217;s codebase \u2014 neither Flyway&#8217;s nor Liquibase&#8217;s &#8220;automatic at startup&#8221; benefit applies directly, because there&#8217;s no single application boot process to hook into.<\/p>\n<p>In this model, enforcement has to be built explicitly into the pipeline:<\/p>\n<ol>\n<li><strong>Discovery stage \u2014<\/strong> the pipeline diffs the merge to figure out which logical database folders changed (git diff &#8211;name-only $(git merge-base &#8230;)), rather than relying on a hand-maintained manifest.<\/li>\n<li><strong>Environment resolution \u2014<\/strong> a single source-of-truth mapping file (e.g. env-db-mapping.json) resolves branch \u2192 environment \u2192 target database\/connection, so there&#8217;s no hardcoding of database names per Jenkins stage.<\/li>\n<li><strong>Execution gate \u2014<\/strong> the pipeline runs the SQL (or Liquibase\/Flyway invoked in CLI mode) as a required stage before the deploy stage, using a changelog table of its own to guarantee idempotency and correct ordering, and to prevent the same script running twice.<\/li>\n<li><strong>Failure = no deploy \u2014<\/strong> if the DB stage fails, the pipeline stops. The application build\/deploy stage is never reached.<br \/>\nThis is more work to build than &#8220;add a library and let it run at boot,&#8221; but it&#8217;s the only model that fits when scripts are decoupled from application code, when a central team needs release control, or when multiple services\/consumers share one database and you don&#8217;t want N different app-boot processes independently racing to apply the same migration.<\/li>\n<\/ol>\n<h2>Comparison at a Glance<\/h2>\n<ul>\n<li><strong>Flyway (Spring Boot) \u2014<\/strong> Enforcement happens at app startup, on every task launch. Requires app-repo coupling. No free rollback (forward-fix only; rollback is a paid Teams feature).<\/li>\n<li><strong>Liquibase (Spring auto-config) \u2014<\/strong> Enforcement happens at app startup, same model as Flyway. Requires app-repo coupling. Rollback is free and built in.<\/li>\n<li><strong>Liquibase (standalone CLI) \u2014<\/strong> Enforcement happens as an explicit Jenkins\/pipeline stage. No app-repo coupling required. Rollback is free and built in.<\/li>\n<li><strong>Raw SQL \/ separate DB-change repo \u2014<\/strong> Enforcement happens as an explicit pipeline stage before deploy. No app-repo coupling required. Rollback only exists if you build it in yourself.<\/li>\n<\/ul>\n<h2><strong>Recommendation<\/strong><\/h2>\n<ul>\n<li><strong>Standard Java\/Spring Boot services that own their schema:<\/strong> use <strong>Flyway<\/strong>. It&#8217;s free forever for the forward-fix pattern, requires no pipeline changes, and is the ecosystem default.<\/li>\n<li><strong>Same setup, but DBAs need self-service rollback without a developer involved:<\/strong> use <strong>Liquibase in Spring auto-config mode<\/strong> instead \u2014 same enforcement model, better rollback story.<\/li>\n<li><strong>Non-Java services, or a central team that must gate schema changes independently of each service&#8217;s deploy cadence:<\/strong> use <strong>Liquibase in standalone CLI<\/strong> mode, driven as a mandatory Jenkins stage.<\/li>\n<li><strong>Schema changes already live in a separate repo, decoupled from application code:<\/strong> neither tool&#8217;s &#8220;automatic at boot&#8221; advantage applies as-is. The enforcement has to be engineered into the pipeline itself \u2014 discovery, environment resolution, and a hard gate before the deploy stage \u2014 which is a structural investment, not a tooling swap.<\/li>\n<\/ul>\n<p>The common thread across all four options: enforcement only works if there is <strong>no path to deployment that skips the schema step<\/strong>. Whether that gate lives inside the JVM&#8217;s boot sequence or inside a Jenkins stage is an implementation detail \u2014 what matters is that skipping it isn&#8217;t an option a person (or a pipeline) can accidentally take.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Problem Every team eventually hits the same failure mode: a new build goes out, the application starts, and it immediately breaks because a required schema change wasn&#8217;t applied first. Maybe someone forgot to run the SQL script. Maybe it ran against the wrong environment. Maybe it ran after the app already tried to query [&hellip;]<\/p>\n","protected":false},"author":2053,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1,"footnotes":""},"categories":[2348],"tags":[4252,8963,1892,8964,1682,421,6785],"class_list":["post-82041","post","type-post","status-publish","format-standard","hentry","category-devops-technology","tag-cicd","tag-dbmigrations","tag-devops","tag-flyway","tag-jenkins","tag-liquibase","tag-schemamanagement"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"The Problem Every team eventually hits the same failure mode: a new build goes out, the application starts, and it immediately breaks because a required schema change wasn&#039;t applied first. Maybe someone forgot to run the SQL script. Maybe it ran against the wrong environment. Maybe it ran after the app already tried to query\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Akshat Mittal\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Enforcing and Automating Database Script Execution Before Application Startup | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"The Problem Every team eventually hits the same failure mode: a new build goes out, the application starts, and it immediately breaks because a required schema change wasn&#039;t applied first. Maybe someone forgot to run the SQL script. Maybe it ran against the wrong environment. Maybe it ran after the app already tried to query\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Enforcing and Automating Database Script Execution Before Application Startup | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The Problem Every team eventually hits the same failure mode: a new build goes out, the application starts, and it immediately breaks because a required schema change wasn&#039;t applied first. Maybe someone forgot to run the SQL script. Maybe it ran against the wrong environment. Maybe it ran after the app already tried to query\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/enforcing-and-automating-database-script-execution-before-application-startup\\\/#article\",\"name\":\"Enforcing and Automating Database Script Execution Before Application Startup | TO THE NEW Blog\",\"headline\":\"Enforcing and Automating Database Script Execution Before Application Startup\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/akshat-mittal\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2026-09-16T12:03:58+05:30\",\"dateModified\":\"2026-09-29T12:17:47+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/enforcing-and-automating-database-script-execution-before-application-startup\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/enforcing-and-automating-database-script-execution-before-application-startup\\\/#webpage\"},\"articleSection\":\"DevOps, CI\\\/CD, DBmigrations, devops, Flyway, Jenkins, liquibase, SchemaManagement\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/enforcing-and-automating-database-script-execution-before-application-startup\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/devops-technology\\\/#listItem\",\"name\":\"DevOps\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/devops-technology\\\/#listItem\",\"position\":2,\"name\":\"DevOps\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/devops-technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/enforcing-and-automating-database-script-execution-before-application-startup\\\/#listItem\",\"name\":\"Enforcing and Automating Database Script Execution Before Application Startup\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/enforcing-and-automating-database-script-execution-before-application-startup\\\/#listItem\",\"position\":3,\"name\":\"Enforcing and Automating Database Script Execution Before Application Startup\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/devops-technology\\\/#listItem\",\"name\":\"DevOps\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/akshat-mittal\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/akshat-mittal\\\/\",\"name\":\"Akshat Mittal\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/enforcing-and-automating-database-script-execution-before-application-startup\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/8ba84e7f-447f-4fc9-8f69-450c7bf708f0_6105-Akshat-Mittal-PROFILEPICTURE.jpeg\",\"width\":96,\"height\":96,\"caption\":\"Akshat Mittal\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/enforcing-and-automating-database-script-execution-before-application-startup\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/enforcing-and-automating-database-script-execution-before-application-startup\\\/\",\"name\":\"Enforcing and Automating Database Script Execution Before Application Startup | TO THE NEW Blog\",\"description\":\"The Problem Every team eventually hits the same failure mode: a new build goes out, the application starts, and it immediately breaks because a required schema change wasn't applied first. Maybe someone forgot to run the SQL script. Maybe it ran against the wrong environment. Maybe it ran after the app already tried to query\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/enforcing-and-automating-database-script-execution-before-application-startup\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/akshat-mittal\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/akshat-mittal\\\/#author\"},\"datePublished\":\"2026-09-16T12:03:58+05:30\",\"dateModified\":\"2026-09-29T12:17:47+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Enforcing and Automating Database Script Execution Before Application Startup | TO THE NEW Blog","description":"The Problem Every team eventually hits the same failure mode: a new build goes out, the application starts, and it immediately breaks because a required schema change wasn't applied first. Maybe someone forgot to run the SQL script. Maybe it ran against the wrong environment. Maybe it ran after the app already tried to query","canonical_url":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/#article","name":"Enforcing and Automating Database Script Execution Before Application Startup | TO THE NEW Blog","headline":"Enforcing and Automating Database Script Execution Before Application Startup","author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/akshat-mittal\/#author"},"publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"},"datePublished":"2026-09-16T12:03:58+05:30","dateModified":"2026-09-29T12:17:47+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/#webpage"},"isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/#webpage"},"articleSection":"DevOps, CI\/CD, DBmigrations, devops, Flyway, Jenkins, liquibase, SchemaManagement"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.tothenew.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/devops-technology\/#listItem","name":"DevOps"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/devops-technology\/#listItem","position":2,"name":"DevOps","item":"https:\/\/www.tothenew.com\/blog\/category\/devops-technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/#listItem","name":"Enforcing and Automating Database Script Execution Before Application Startup"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/#listItem","position":3,"name":"Enforcing and Automating Database Script Execution Before Application Startup","previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/devops-technology\/#listItem","name":"DevOps"}}]},{"@type":"Organization","@id":"https:\/\/www.tothenew.com\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/www.tothenew.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.tothenew.com\/blog\/author\/akshat-mittal\/#author","url":"https:\/\/www.tothenew.com\/blog\/author\/akshat-mittal\/","name":"Akshat Mittal","image":{"@type":"ImageObject","@id":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/8ba84e7f-447f-4fc9-8f69-450c7bf708f0_6105-Akshat-Mittal-PROFILEPICTURE.jpeg","width":96,"height":96,"caption":"Akshat Mittal"}},{"@type":"WebPage","@id":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/#webpage","url":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/","name":"Enforcing and Automating Database Script Execution Before Application Startup | TO THE NEW Blog","description":"The Problem Every team eventually hits the same failure mode: a new build goes out, the application starts, and it immediately breaks because a required schema change wasn't applied first. Maybe someone forgot to run the SQL script. Maybe it ran against the wrong environment. Maybe it ran after the app already tried to query","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/#breadcrumblist"},"author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/akshat-mittal\/#author"},"creator":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/akshat-mittal\/#author"},"datePublished":"2026-09-16T12:03:58+05:30","dateModified":"2026-09-29T12:17:47+05:30"},{"@type":"WebSite","@id":"https:\/\/www.tothenew.com\/blog\/#website","url":"https:\/\/www.tothenew.com\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Enforcing and Automating Database Script Execution Before Application Startup | TO THE NEW Blog","og:description":"The Problem Every team eventually hits the same failure mode: a new build goes out, the application starts, and it immediately breaks because a required schema change wasn't applied first. Maybe someone forgot to run the SQL script. Maybe it ran against the wrong environment. Maybe it ran after the app already tried to query","og:url":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/","og:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Enforcing and Automating Database Script Execution Before Application Startup | TO THE NEW Blog","twitter:description":"The Problem Every team eventually hits the same failure mode: a new build goes out, the application starts, and it immediately breaks because a required schema change wasn't applied first. Maybe someone forgot to run the SQL script. Maybe it ran against the wrong environment. Maybe it ran after the app already tried to query","twitter:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"82041","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"limit_modified_date":false,"created":"2026-09-01 13:40:18","updated":"2026-09-29 06:47:48","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\/category\/devops-technology\/\" title=\"DevOps\">DevOps<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tEnforcing and Automating Database Script Execution Before Application Startup\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.tothenew.com\/blog"},{"label":"DevOps","link":"https:\/\/www.tothenew.com\/blog\/category\/devops-technology\/"},{"label":"Enforcing and Automating Database Script Execution Before Application Startup","link":"https:\/\/www.tothenew.com\/blog\/enforcing-and-automating-database-script-execution-before-application-startup\/"}],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/82041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/2053"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=82041"}],"version-history":[{"count":3,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/82041\/revisions"}],"predecessor-version":[{"id":83759,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/82041\/revisions\/83759"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=82041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=82041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=82041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}