bmc_hub/migrations/072_locations_parent_relation.sql
Christian 29acdf3e01 Add tests for new SAG module endpoints and module deactivation
- Implement test script for new SAG module endpoints BE-003 (Tag State Management) and BE-004 (Bulk Operations).
- Create test cases for creating, updating, and bulk operations on cases and tags.
- Add a test for module deactivation to ensure data integrity is maintained.
- Include setup and teardown for tests to clear database state before and after each test.
2026-01-31 23:16:24 +01:00

20 lines
545 B
PL/PgSQL

-- Migration: 072_locations_parent_relation
-- Created: 2026-01-31
-- Description: Add hierarchical parent relationship to locations
BEGIN;
ALTER TABLE locations_locations
ADD COLUMN IF NOT EXISTS parent_location_id INTEGER;
ALTER TABLE locations_locations
ADD CONSTRAINT locations_locations_parent_location_id_fkey
FOREIGN KEY (parent_location_id)
REFERENCES locations_locations(id)
ON DELETE SET NULL;
CREATE INDEX IF NOT EXISTS idx_locations_parent_location_id
ON locations_locations(parent_location_id);
COMMIT;