1. MooseStack
  2. Moose Migrate
  3. Deletion Protected Lifecycle

On this page

BehaviorExamples

Deletion Protected

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.

Behavior

What Moose will do:

  • Add new columns, tables
  • Modify column types (if compatible)
  • Update non-destructive configurations

What Moose won't do:

  • Drop columns or tables
  • Perform destructive schema changes

Examples

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});
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplates
Changelog
Source506
  • Overview
  • Quick Start
  • Templates / Examples
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Data Modeling
MooseStack in your App
  • App / API frameworks
Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs
Deployment & Lifecycle
  • Moose Migrate
    • Migration Modes
    • Automatic Migrations
    • Planned Migrations
    • Plan Reference
    • Executing Migrations
    • moose migrate (CLI)
    • moose prod (Runtime)
    • Lifecycle Management
    • Fully Managed
    • Deletion Protected
    • Externally Managed
    • Advanced Topics
    • Failed Migrations
  • Moose Deploy
Reference
  • API Reference
  • Data Types
  • Table Engines
  • CLI
  • Configuration
  • Observability Metrics
  • Help
  • Changelog
Contribution
  • Documentation
  • Framework