feat(trucks): site_id column and site/truck helpers
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
-- Apply by hand on the server DB with the owner's go-ahead. Not run by deploy.
|
||||
BEGIN;
|
||||
ALTER TABLE trucks ADD COLUMN IF NOT EXISTS site_id UUID REFERENCES sites(id);
|
||||
CREATE INDEX IF NOT EXISTS trucks_site_id_idx ON trucks(site_id);
|
||||
COMMIT;
|
||||
@@ -101,6 +101,9 @@ CREATE TABLE trucks (
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
ALTER TABLE trucks ADD COLUMN IF NOT EXISTS site_id UUID REFERENCES sites(id);
|
||||
CREATE INDEX IF NOT EXISTS trucks_site_id_idx ON trucks(site_id);
|
||||
|
||||
-- incidents: final column set includes all columns added in later migrations
|
||||
CREATE TABLE incidents (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
|
||||
Reference in New Issue
Block a user