home.social

#foreignkey β€” Public Fediverse posts

Live and recent posts from across the Fediverse tagged #foreignkey, aggregated by home.social.

  1. One DELETE Cascades To 3.5 MILLION Rows?!

    PRODUCTION APOCALYPSE! Deleted ONE user and CASCADE deleted 3.5 MILLION rows across 4 tables! Orders, payments, everything GONE! This is the scariest SQL behavior! Watch this nightmare!

    #sql #sqldisaster #cascadedelete #foreignkey #productionbug #dataloss #sqlfails #massdeletion #sqlshorts #databasedisaster #sqlwtf #cascadenightmare

    youtube.com/watch?v=pE_OMbOia_w

  2. # #dt260208
    # #sql
    # #primarykey
    # #foreignkey
    # #SQLite

    I had chatgpt refactor the bookbiz database schema (from PracticalSQL book 2nd ed). It added primary and foreign keys. I then had it refactor for SQLite specifically.

    chatgpt.com/share/69894b9c-b94

    ...

    Highlights:

    1. SQLite-Idiomatic Schema (Clean Rewrite)
    Global settings (critical in SQLite)
    PRAGMA foreign_keys = ON;
    PRAGMA journal_mode = WAL;
    PRAGMA synchronous = NORMAL;

  3. Django 5.0 has been released πŸŽ‰

    After months of work, everyone can use this great new version πŸ™Œ

    My favorite features are:
    β€’ πŸ€– generated fields
    β€’ βœ… database default values
    β€’ πŸ”‘ prefetch related for generic foreign keys

    Which are your favorite features?
    djangoproject.com/weblog/2023/