erp-construccion-database-v2/schemas
Adrian Flores Cortes 094cbe3ffb [EPIC-002] feat: Add user_id FK to employees + rename warehouse_type
T2.1: Renamed warehouse_type -> construction_warehouse_type
      in almacenes_proyecto to avoid naming conflict with ERP-Core

T2.3: Added user_id column to hr.employees
      - Optional FK to auth.users (employee may not have system access)
      - Unique constraint for 1:1 mapping
      - Conditional FK (only created if auth.users exists)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 00:20:02 -06:00
..
01-construction-schema-ddl.sql [MAI-012] feat: Add DDL for contrato_addendas table 2026-01-25 09:08:50 -06:00
02-hr-schema-ddl.sql [EPIC-002] feat: Add user_id FK to employees + rename warehouse_type 2026-02-04 00:20:02 -06:00
03-hse-schema-ddl.sql [EPIC-001-FK-DEBILES] feat(ddl): Add conditional FK constraints to fix weak references 2026-02-04 00:00:23 -06:00
04-estimates-schema-ddl.sql Migración desde erp-construccion/database - Estándar multi-repo v2 2026-01-16 08:11:21 -06:00
05-infonavit-schema-ddl.sql Migración desde erp-construccion/database - Estándar multi-repo v2 2026-01-16 08:11:21 -06:00
06-inventory-ext-schema-ddl.sql [EPIC-002] feat: Add user_id FK to employees + rename warehouse_type 2026-02-04 00:20:02 -06:00
07-purchase-ext-schema-ddl.sql [EPIC-001-FK-DEBILES] feat(ddl): Add conditional FK constraints to fix weak references 2026-02-04 00:00:23 -06:00
08-finance-schema-ddl.sql [MAE-014] feat: Add finance schema DDL with 11 tables and 20 ENUMs 2026-01-25 05:08:19 -06:00
09-assets-schema-ddl.sql [MAE-015] feat: Add assets schema DDL with 11 tables and 9 ENUMs 2026-01-25 05:11:02 -06:00
10-documents-schema-ddl.sql [EPIC-001-FK-DEBILES] feat(ddl): Add conditional FK constraints to fix weak references 2026-02-04 00:00:23 -06:00
11-compound-indices.sql [ST-P2-002,ST-P2-003] feat: Add compound indices and JSONB schema documentation 2026-02-03 07:39:14 -06:00
99-rls-policies.sql [TASK-029] security: Add RLS policies for 86 construction tables 2026-01-24 22:32:39 -06:00