Skip to main content

alter_sql

Function alter_sql 

Source
pub fn alter_sql(table: &str, diff: &SchemaDiff, force: bool) -> String
Expand description

Render an ALTER TABLE migration that reconciles table to its declared shape.

Added columns are emitted nullable (not NOT NULL) even though Gize’s create tables are NOT NULL: adding a NOT NULL column without a default to a table that may hold rows fails, so the safe move is a nullable column plus a -- TODO to backfill and tighten (ADR-011 revision). Drops are only included when force is set.