LifeCycle.DELETION_PROTECTED allows MooseStack to automatically add new database structures but prevents it from removing existing ones. This mode is perfect for production environments where you want to evolve your schema safely without risking data loss.
What Moose will do:
What Moose won't do:
import { OlapTable, LifeCycle, ClickHouseEngines } from "@514labs/moose-lib"; interface ProductEvent { id: string; productId: string; timestamp: Date; action: string;} const productAnalytics = new OlapTable<ProductEvent>("product_analytics", { orderByFields: ["timestamp", "productId"], engine: ClickHouseEngines.ReplacingMergeTree, lifeCycle: LifeCycle.DELETION_PROTECTED});import { OlapTable, LifeCycle, ClickHouseEngines } from "@514labs/moose-lib"; interface ProductEvent { id: string; productId: string; timestamp: Date; action: string;} const productAnalytics = new OlapTable<ProductEvent>("product_analytics", { orderByFields: ["timestamp", "productId"], engine: ClickHouseEngines.ReplacingMergeTree, lifeCycle: LifeCycle.DELETION_PROTECTED});