---
title: "Post mortem on Linear incident from Jan 24th, 2024"
description: "A database migration using `TRUNCATE TABLE ... CASCADE` on two new, unused tables silently wiped every production table with foreign keys to them, including issue and document descriptions, comments, notifications and reactions."
url: "https://swe.quest/articles/post-mortem-on-linear-incident-from-jan-24th-2024-c1bcc35cc14b559c"
canonical: "https://linear.app/now/linear-incident-on-jan-24th-2024"
source: "Linear"
published: "2024-01-30"
difficulty: "medium"
kind: "Incident"
reading_minutes: 9
tags: ["incident-response","postgres","schema-migrations","local-first"]
---

# Post mortem on Linear incident from Jan 24th, 2024

A post on [Linear](https://swe.quest/sources/linear.md), published 2024-01-30, 9 min read, Incident. Original: [https://linear.app/now/linear-incident-on-jan-24th-2024](https://linear.app/now/linear-incident-on-jan-24th-2024)

## Summary

A database migration using \`TRUNCATE TABLE ... CASCADE\` on two new, unused tables silently wiped every production table with foreign keys to them, including issue and document descriptions, comments, notifications and reactions. Layered caching in Linear's sync engine hid the loss for about 30 minutes, and sync-lag warnings were excluded from alerting. Because point-in-time recovery had never been tested, the team restored a full backup from hours earlier, causing an hour of downtime and five hours of lost changes. They then replayed sync-engine action logs per workspace, with dry-runs first, recovering over 99% of data within 36 hours; follow-ups include revoking TRUNCATE privileges, linting migrations, PITR tooling and a read-only mode.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Incidents & postmortems](https://swe.quest/tags/incident-response.md) (Reliability & operations)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Schema migrations](https://swe.quest/tags/schema-migrations.md) (Data & databases)
- [Local-first & sync](https://swe.quest/tags/local-first.md) (Architecture & design)

## Prerequisites

- PostgreSQL foreign keys ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- database migrations ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))
- database backups and restore ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

Linear, PostgreSQL, TRUNCATE CASCADE, point-in-time recovery, Redis, sync engine

## Related posts

- [Incident Report: September 22nd, 2025](https://swe.quest/articles/incident-report-september-22nd-2025-f36fdb64699f52a7.md): Railway · 2025-09-22 · Medium · 5 min read · Incidents & postmortems, PostgreSQL, Schema migrations, Resilience, Deployment
  A schema change removing an unused column was partially reverted by a later code change, breaking a core API and leaving Railway's project canvas stuck loading.
- [Incident 2023-12-04: Data leak and loss in some free tier databases](https://swe.quest/articles/incident-2023-12-04-data-leak-and-loss-in-some-free-tier-databases-f301d07a6ce79951.md): Turso · 2023-12-05 · Medium · 3 min read · Incidents & postmortems, Multi-tenancy, Storage systems, Security, Serverless
  A migration bug introduced on November 20 left 0.07% of Turso free-tier databases with an empty backup identifier, so they all pointed at a shared S3 prefix (s3://bucket//) instead of per-database paths.
- [Incident Report: October 28th, 2025](https://swe.quest/articles/incident-report-october-28th-2025-842ec59ef90dc7e9.md): Railway · 2025-10-28 · Medium · 2 min read · PostgreSQL, Schema migrations, Incidents & postmortems, Databases
  A schema migration that added an indexed column to a ~1 billion-row Postgres table without \`CREATE INDEX CONCURRENTLY\` took an exclusive table lock, queuing nearly all backend API queries and taking down Railway's dashboard, CLI, Public API and GitHub webhook deploys for about 40 minutes.
- [I Dropped a Table in Production—Now What?](https://swe.quest/articles/i-dropped-a-table-in-production-now-what-e098e81a35749033.md): Neon · 2025-02-18 · Medium · 7 min read · PostgreSQL, Databases, Incidents & postmortems
  Neon's instant point-in-time recovery creates a new copy-on-write branch at a moment just before a dropped table.
- [I don't trust ON DELETE CASCADE](https://swe.quest/articles/i-don-t-trust-on-delete-cascade-44280f7ae72c78f6.md): PlanetScale · 2026-10-21 · Medium · 5 min read · PostgreSQL, Schema migrations, Replication, Databases
  Postgres ON DELETE CASCADE turns a single-row delete into an unbounded transaction that can cause outages at scale.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
