12 lines
425 B
MySQL
12 lines
425 B
MySQL
|
|
-- A patch/switch port can be registered before the wall-outlet label is known.
|
||
|
|
ALTER TABLE locations_wall_outlets
|
||
|
|
ALTER COLUMN outlet_number DROP NOT NULL;
|
||
|
|
|
||
|
|
ALTER TABLE locations_wall_outlets
|
||
|
|
ADD COLUMN IF NOT EXISTS customer_id INTEGER
|
||
|
|
REFERENCES customers(id) ON DELETE SET NULL;
|
||
|
|
|
||
|
|
CREATE INDEX IF NOT EXISTS idx_wall_outlets_customer_id
|
||
|
|
ON locations_wall_outlets(customer_id)
|
||
|
|
WHERE deleted_at IS NULL;
|