We value your privacy

This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content. See our Privacy Policy.

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

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

DeletionProtectedExample.ts
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});

On this page

BehaviorExamples
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackHostingTemplatesGuides
Release Notes
Source531
  • Overview
Build a New App
  • 5 Minute Quickstart
  • Browse Templates
  • Existing ClickHouse
Add to Existing App
  • Next.js
  • Fastify
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Language Server
  • Data Modeling
Moose Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs & Web Apps
Deployment & Lifecycle
  • Moose Dev
  • 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
  • Release Notes
Contribution
  • Documentation
  • Framework
DeletionProtectedExample.ts
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});