@codified/cli 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ -- 006: Multi-project support
2
+ -- Add project_id to nodes and edges, create projects table
3
+
4
+ -- Projects table
5
+ CREATE TABLE IF NOT EXISTS projects (
6
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
7
+ name TEXT UNIQUE NOT NULL,
8
+ description TEXT,
9
+ created_at TIMESTAMPTZ DEFAULT now(),
10
+ updated_at TIMESTAMPTZ DEFAULT now()
11
+ );
12
+
13
+ -- Insert default project
14
+ INSERT INTO projects (id, name, description)
15
+ VALUES ('00000000-0000-0000-0000-000000000000', 'default', 'Default project')
16
+ ON CONFLICT (id) DO NOTHING;
17
+
18
+ -- Add project_id to nodes
19
+ ALTER TABLE nodes ADD COLUMN IF NOT EXISTS project_id UUID DEFAULT '00000000-0000-0000-0000-000000000000' REFERENCES projects(id);
20
+ CREATE INDEX IF NOT EXISTS idx_nodes_project_id ON nodes (project_id);
21
+
22
+ -- Add project_id to edges
23
+ ALTER TABLE edges ADD COLUMN IF NOT EXISTS project_id UUID DEFAULT '00000000-0000-0000-0000-000000000000' REFERENCES projects(id);
24
+ CREATE INDEX IF NOT EXISTS idx_edges_project_id ON edges (project_id);
@@ -0,0 +1,17 @@
1
+ CREATE TABLE IF NOT EXISTS collection_metrics (
2
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
3
+ computed_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
4
+ period_start TIMESTAMPTZ NOT NULL,
5
+ period_end TIMESTAMPTZ NOT NULL,
6
+ total_plans_created INTEGER NOT NULL DEFAULT 0,
7
+ total_plans_completed INTEGER NOT NULL DEFAULT 0,
8
+ total_plans_failed INTEGER NOT NULL DEFAULT 0,
9
+ avg_time_to_fill_ms BIGINT,
10
+ median_time_to_fill_ms BIGINT,
11
+ response_rate NUMERIC(5,4),
12
+ channel_stats JSONB DEFAULT '{}',
13
+ gap_type_stats JSONB DEFAULT '{}',
14
+ metadata JSONB DEFAULT '{}'
15
+ );
16
+
17
+ CREATE INDEX IF NOT EXISTS idx_collection_metrics_computed ON collection_metrics(computed_at DESC);