//
// Unified Query Algebra
//
// Copyright (c) 2023-2026 Cognica, Inc.
//
//! Persistent table storage generations.
use super::super::super::{Catalog, Result};
pub(super) fn migrate(tx: &rusqlite::Connection) -> Result<()> {
let generation_already_present = Catalog::table_columns(tx, "_tables")?
.is_some_and(|columns| columns.contains_key("storage_generation"));
if !generation_already_present {
tx.execute_batch(
"ALTER TABLE _tables
ADD COLUMN storage_generation BLOB NOT NULL DEFAULT X'00000000000000000000000000000000';",
)?;
}
Ok(())
}