@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix edu: <https://knobit.org/def/> .
@prefix knobit: <https://knobit.org/id/knobit/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix register: <https://knobit.org/id/register/> .
@prefix schema: <https://schema.org/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

knobit:K-822 a edu:Knobit ;
    rdfs:label "Recognises greenfield DDL aimed at a populated database"@en ;
    dcterms:identifier "K-822" ;
    dcterms:license <https://creativecommons.org/licenses/by/4.0/> ;
    dcterms:source "Review checklist 05-ddl, row 22; Ambler & Sadalage 2006; this skill (08-ddl.md)"@en ;
    skos:altLabel "Greenfield DDL run against a populated database (generated DDL)"@en ;
    skos:definition "`08-ddl/` handed to a release for an environment that already has data. This output builds a schema from nothing. The changes that look smallest in the diff are the ones that need a backfill plan — a nullable column tightened to `NOT NULL`, a widened or narrowed type, a split column — and on Databricks `ALTER TABLE ... ADD CONSTRAINT` validates the existing rows and fails on the first violation."@en ;
    skos:prefLabel "Recognises greenfield DDL aimed at a populated database"@en ;
    edu:actionVerb "Recognises"@en ;
    edu:appliesKnowledge knobit:K-857 ;
    edu:assessmentCriterion "Flags the deficient case and passes the acceptable one. Deficient: `account_number` tightened to `NOT NULL` in the model and the regenerated DDL given to the release; 3 % of migrated accounts have no IBAN, the deploy fails halfway, and the schema is left with half its constraints applied Acceptable: The regenerated DDL diffed against the previous version as the statement of intent, and the migration hand-written for that diff where deployment lives (Flyway, Liquibase, dbt, Alembic) with backfill and rollback — then verified by rebuilding an empty database from the generated DDL and comparing it with the migrated one"@en ;
    edu:assessmentMethod "skill-tests task: Generated DDL review, Postgres and Snowflake (DDL review skills)"@en ;
    edu:contextFunction <https://knobit.org/def/contextFunction/resultEvaluation> ;
    edu:creationMethod <https://knobit.org/def/creationMethod/aiGeneratedHumanEdited> ;
    edu:expectedResult "The changes needing a backfill and a migration"@en ;
    edu:graphRelevance <https://knobit.org/def/graphRelevance/learnerState>,
        <https://knobit.org/def/graphRelevance/taskSelection> ;
    edu:knobitType <https://knobit.org/def/knobitType/skill> ;
    edu:targetObject "generated DDL for a release"@en ;
    schema:creativeWorkStatus "accepted" ;
    schema:isPartOf register:data-modelling .

edu:Knobit rdfs:label "Knobit"@en,
        "Knobit"@et .

knobit:K-857 rdfs:label "Explains schema migration and rollback"@en .

