Tracking Schema Changes Without a Framework — Run-Once Scripts, Checksums and Immutability

The backfill ran a second time on the second deploy — and overwrote values that had been corrected by the business in the meantime. Accidents like this are not prevented by discipline, only by a memory: if you want to track database schema changes without introducing Flyway or Liquibase, all it takes is exactly one table and … Read more

Adding a NOT NULL Column to a Populated Table — the Expand/Contract Pattern

The ALTER TABLE ran through cleanly on your machine — on staging, the same deploy fails with column “country_code” of relation “customer” contains null values. The difference is not the SQL, it is the data: the local table was empty, the one on staging was not. If you want to add a NOT NULL column to an existing table that … Read more

Maximal Template Over Empty Repo — a Claude Code Setup That Prunes Itself via /init

Every new project starts with the same ritual: create an empty repo, then hunt down the folder structure, the conventions and the workflow files from the last project — and forget half of them. A Claude Code project template can invert that reflex: instead of starting with nothing and building up piece by piece, you … Read more

Skills vs. Rules in Claude Code — What Auto-Loads, What Loads on Demand, and the Context Cost

Inside a Claude Code project’s .claude/ folder, rules and skills sit side by side: Markdown files that look almost identical — and behave in exactly opposite ways. That contrast is what Claude Code skills vs rules comes down to: rules are fully in context at every session start; a skill costs next to nothing until someone invokes it. Get … Read more

Deploying a SQL Schema Without a Migration Tool — Directory Convention Instead of Flyway or Liquibase

The schema is done — now what? The reflex answer is Flyway or Liquibase. But for a small, database-centric project, a migration tool is often more machinery than the task calls for: its own version table, a runtime dependency, a file format you commit to. There is another way. Deploying a Postgres schema without a migration … Read more

Data Quality: Dimensions and Error Classes — the Theory Behind the SQL Checks

A lot gets written about data quality, and very little gets measured. The German-language practitioner’s standard reference alone lists sixty possible quality criteria — from timeliness to reliability —, and even the lean models still arrive at six to fifteen dimensions. Yet the core of the matter is surprisingly tangible: a data error caught during … Read more

Finding Orphaned Records — Checking Referential Integrity Without a Foreign Key

A foreign key pointing into the void is quick to describe — a country_code with no matching entry in the reference data — and surprisingly easy to check incorrectly. The most intuitive phrasing is, of all things, the most dangerous: NOT IN (SELECT …) reads like plain English but silently collapses the moment the reference column holds a single NULL. The … Read more

Validating Data with SQL — Ranges, Required Fields and the NULL Trap

A range check that runs green is no proof of clean data. Anyone who writes WHERE age < 0 OR age > 120 to find implausible ages silently misses every row where age has no value at all — because in SQL, a comparison with NULL is neither true nor false, but unknown. That very missing required value later breaks the load into the strictly … Read more

Design Pattern // Safe Type Conversion with T-SQL — Catch Errors Instead of Aborting the ETL Process

A single value that won’t convert — a 25.5 in an integer column, an empty string, a date like 20240230 — and the ETL run aborts mid-import. Anyone who loads text data from upstream systems knows it: the delivery doesn’t honour the agreed interface, and a bare CONVERT throws an exception instead of cleanly logging the offending value. This article describes … Read more