From 8bef895fe4636c6912b2d8eddce2cc30a98cff57 Mon Sep 17 00:00:00 2001 From: Max Chis <48846180+maxachis@users.noreply.github.com> Date: Tue, 12 Aug 2025 08:49:51 -0400 Subject: [PATCH] Update DESIGN-PRINCIPLES.md Add information on flag tables. --- DESIGN-PRINCIPLES.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/DESIGN-PRINCIPLES.md b/DESIGN-PRINCIPLES.md index 9fe02b8..578c7e1 100644 --- a/DESIGN-PRINCIPLES.md +++ b/DESIGN-PRINCIPLES.md @@ -250,6 +250,15 @@ The following columns should be present in all tables unless there is a compelli - one-to-many: unique constraint on the `one` column - many-to-many: single unique constraint encompassing *both* columns +## Flag Tables + +Flag tables are tables that are used to indicate the presence of an attribute on a row in another table. Typically, a flag table is used where that attribute is not shared by all URLs in that table (for example, whether a URL is a Root URL). + +Flag tables should have the following characteristics: +- Named with a `flag_` prefix to denote that they are flag tables. +- Contain a foreign key that also exists as the primary key -- a separate "id" key is not required. +- Contain a `created_at` datetime column. + # SQLAlchemy -