feat(db): add customers/vendors tables and seed data

Extend schema with customers and vendors tables, add project
fields (status, address, client_name, project_manager), and
seed with 40 customers, 25 vendors, and 10 projects from
client CSV data.
This commit is contained in:
Nicholai Vogel 2026-01-24 13:29:32 -07:00
parent 46456b1461
commit 006c960ac2
7 changed files with 1153 additions and 0 deletions

View File

@ -0,0 +1,4 @@
ALTER TABLE `projects` ADD `status` text DEFAULT 'OPEN' NOT NULL;--> statement-breakpoint
ALTER TABLE `projects` ADD `address` text;--> statement-breakpoint
ALTER TABLE `projects` ADD `client_name` text;--> statement-breakpoint
ALTER TABLE `projects` ADD `project_manager` text;

17
drizzle/0003_burly_kabuki.sql Executable file
View File

@ -0,0 +1,17 @@
CREATE TABLE `customers` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`email` text,
`phone` text,
`created_at` text NOT NULL
);
--> statement-breakpoint
CREATE TABLE `vendors` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`category` text DEFAULT 'Subcontractor' NOT NULL,
`email` text,
`phone` text,
`address` text,
`created_at` text NOT NULL
);

449
drizzle/meta/0002_snapshot.json Executable file
View File

@ -0,0 +1,449 @@
{
"version": "6",
"dialect": "sqlite",
"id": "1bf700a8-c2d0-4d52-bfdc-ea098422e755",
"prevId": "b55a2897-53cb-4da9-bfdb-c05ee8b6c08c",
"tables": {
"projects": {
"name": "projects",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'OPEN'"
},
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"client_name": {
"name": "client_name",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"project_manager": {
"name": "project_manager",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"schedule_baselines": {
"name": "schedule_baselines",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"snapshot_data": {
"name": "snapshot_data",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"schedule_baselines_project_id_projects_id_fk": {
"name": "schedule_baselines_project_id_projects_id_fk",
"tableFrom": "schedule_baselines",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"schedule_tasks": {
"name": "schedule_tasks",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"start_date": {
"name": "start_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"workdays": {
"name": "workdays",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"end_date_calculated": {
"name": "end_date_calculated",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"phase": {
"name": "phase",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'PENDING'"
},
"is_critical_path": {
"name": "is_critical_path",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
},
"is_milestone": {
"name": "is_milestone",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
},
"percent_complete": {
"name": "percent_complete",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"assigned_to": {
"name": "assigned_to",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"sort_order": {
"name": "sort_order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"schedule_tasks_project_id_projects_id_fk": {
"name": "schedule_tasks_project_id_projects_id_fk",
"tableFrom": "schedule_tasks",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"task_dependencies": {
"name": "task_dependencies",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"predecessor_id": {
"name": "predecessor_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"successor_id": {
"name": "successor_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'FS'"
},
"lag_days": {
"name": "lag_days",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
}
},
"indexes": {},
"foreignKeys": {
"task_dependencies_predecessor_id_schedule_tasks_id_fk": {
"name": "task_dependencies_predecessor_id_schedule_tasks_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "schedule_tasks",
"columnsFrom": [
"predecessor_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"task_dependencies_successor_id_schedule_tasks_id_fk": {
"name": "task_dependencies_successor_id_schedule_tasks_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "schedule_tasks",
"columnsFrom": [
"successor_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"workday_exceptions": {
"name": "workday_exceptions",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"start_date": {
"name": "start_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"end_date": {
"name": "end_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'non_working'"
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'company_holiday'"
},
"recurrence": {
"name": "recurrence",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'one_time'"
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"workday_exceptions_project_id_projects_id_fk": {
"name": "workday_exceptions_project_id_projects_id_fk",
"tableFrom": "workday_exceptions",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}

554
drizzle/meta/0003_snapshot.json Executable file
View File

@ -0,0 +1,554 @@
{
"version": "6",
"dialect": "sqlite",
"id": "20ead1c6-feea-44d0-8b20-6f4a5c6989ab",
"prevId": "1bf700a8-c2d0-4d52-bfdc-ea098422e755",
"tables": {
"customers": {
"name": "customers",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"phone": {
"name": "phone",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"projects": {
"name": "projects",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'OPEN'"
},
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"client_name": {
"name": "client_name",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"project_manager": {
"name": "project_manager",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"schedule_baselines": {
"name": "schedule_baselines",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"snapshot_data": {
"name": "snapshot_data",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"schedule_baselines_project_id_projects_id_fk": {
"name": "schedule_baselines_project_id_projects_id_fk",
"tableFrom": "schedule_baselines",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"schedule_tasks": {
"name": "schedule_tasks",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"start_date": {
"name": "start_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"workdays": {
"name": "workdays",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"end_date_calculated": {
"name": "end_date_calculated",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"phase": {
"name": "phase",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'PENDING'"
},
"is_critical_path": {
"name": "is_critical_path",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
},
"is_milestone": {
"name": "is_milestone",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
},
"percent_complete": {
"name": "percent_complete",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"assigned_to": {
"name": "assigned_to",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"sort_order": {
"name": "sort_order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"schedule_tasks_project_id_projects_id_fk": {
"name": "schedule_tasks_project_id_projects_id_fk",
"tableFrom": "schedule_tasks",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"task_dependencies": {
"name": "task_dependencies",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"predecessor_id": {
"name": "predecessor_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"successor_id": {
"name": "successor_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'FS'"
},
"lag_days": {
"name": "lag_days",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
}
},
"indexes": {},
"foreignKeys": {
"task_dependencies_predecessor_id_schedule_tasks_id_fk": {
"name": "task_dependencies_predecessor_id_schedule_tasks_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "schedule_tasks",
"columnsFrom": [
"predecessor_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"task_dependencies_successor_id_schedule_tasks_id_fk": {
"name": "task_dependencies_successor_id_schedule_tasks_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "schedule_tasks",
"columnsFrom": [
"successor_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"vendors": {
"name": "vendors",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'Subcontractor'"
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"phone": {
"name": "phone",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"workday_exceptions": {
"name": "workday_exceptions",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"start_date": {
"name": "start_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"end_date": {
"name": "end_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'non_working'"
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'company_holiday'"
},
"recurrence": {
"name": "recurrence",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'one_time'"
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"workday_exceptions_project_id_projects_id_fk": {
"name": "workday_exceptions_project_id_projects_id_fk",
"tableFrom": "workday_exceptions",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}

View File

@ -15,6 +15,20 @@
"when": 1769222679525,
"tag": "0001_gorgeous_sebastian_shaw",
"breakpoints": true
},
{
"idx": 2,
"version": "6",
"when": 1769231679439,
"tag": "0002_tricky_harpoon",
"breakpoints": true
},
{
"idx": 3,
"version": "6",
"when": 1769286212480,
"tag": "0003_burly_kabuki",
"breakpoints": true
}
]
}

89
seed.sql Executable file
View File

@ -0,0 +1,89 @@
-- Seed data for COMPASS
-- Run with: wrangler d1 execute compass-db --local --file=seed.sql
-- ─── Customers (from Customers324.csv) ───
INSERT OR IGNORE INTO customers (id, name, email, phone, created_at) VALUES
('cust-001', 'Greg Smith', NULL, NULL, '2023-07-27T08:00:00Z'),
('cust-002', 'Andrew and Karen Rodney', NULL, NULL, '2023-07-27T08:00:00Z'),
('cust-003', 'Sandra Coen', NULL, NULL, '2023-08-15T10:00:00Z'),
('cust-004', 'Keith & Jennifer Hinson', NULL, NULL, '2023-09-01T08:00:00Z'),
('cust-005', 'Gerald and Kristi Taylor', NULL, NULL, '2023-09-10T09:00:00Z'),
('cust-006', 'Travis and Tanis Loomis', NULL, NULL, '2023-10-01T08:00:00Z'),
('cust-007', 'James McGorry', NULL, NULL, '2023-10-15T10:00:00Z'),
('cust-008', 'Redline Pipeline', NULL, NULL, '2023-11-01T08:00:00Z'),
('cust-009', 'Justin Rapp', NULL, NULL, '2023-11-15T09:00:00Z'),
('cust-010', 'Matt B Willson', NULL, NULL, '2023-12-01T08:00:00Z'),
('cust-011', 'Izabela Bigley', NULL, NULL, '2024-01-10T08:00:00Z'),
('cust-012', 'Rob Montano', NULL, NULL, '2024-02-01T09:00:00Z'),
('cust-013', 'Robert Kelsey', NULL, NULL, '2024-03-01T08:00:00Z'),
('cust-014', 'Chris Auger', NULL, NULL, '2024-03-15T10:00:00Z'),
('cust-015', 'Joseph Clifford', NULL, NULL, '2024-04-01T08:00:00Z'),
('cust-016', 'Dan Maley', NULL, NULL, '2024-05-01T09:00:00Z'),
('cust-017', 'Russ Gehling', NULL, NULL, '2024-06-01T08:00:00Z'),
('cust-018', 'James (Jimmy) Lusero', NULL, NULL, '2024-07-01T10:00:00Z'),
('cust-019', 'Bach Builders LLC', NULL, NULL, '2024-08-01T08:00:00Z'),
('cust-020', 'Mark Myers', NULL, NULL, '2024-09-01T09:00:00Z'),
('cust-021', 'William M Rainey', NULL, NULL, '2024-01-15T08:00:00Z'),
('cust-022', 'Craig Chellis', NULL, NULL, '2024-02-20T09:00:00Z'),
('cust-023', 'Donald Henrich', NULL, NULL, '2024-03-10T08:00:00Z'),
('cust-024', 'Kelsey & Daniel Dougherty', NULL, NULL, '2024-04-05T10:00:00Z'),
('cust-025', 'German Nevarez', NULL, NULL, '2024-05-12T08:00:00Z'),
('cust-026', 'Eric Wammel', NULL, NULL, '2024-06-20T09:00:00Z'),
('cust-027', 'Troy & Wendy Reiter', NULL, NULL, '2024-07-15T08:00:00Z'),
('cust-028', 'Fish Builders', NULL, NULL, '2024-08-01T10:00:00Z'),
('cust-029', 'Nathan and Lisa Wood', NULL, NULL, '2024-09-10T08:00:00Z'),
('cust-030', 'Stephanie Wetherby', NULL, NULL, '2024-10-01T09:00:00Z'),
('cust-031', 'Terry Weatherford', NULL, NULL, '2024-11-01T08:00:00Z'),
('cust-032', 'Scott Edwards', NULL, NULL, '2024-12-01T10:00:00Z'),
('cust-033', 'Tom Backes', NULL, NULL, '2025-01-15T08:00:00Z'),
('cust-034', 'James Chaney', NULL, NULL, '2025-02-01T09:00:00Z'),
('cust-035', 'Michael Ziehler', NULL, NULL, '2025-03-10T08:00:00Z'),
('cust-036', 'Alec Korver', NULL, NULL, '2025-04-01T10:00:00Z'),
('cust-037', 'David & Debi Strom', NULL, NULL, '2025-05-01T08:00:00Z'),
('cust-038', 'Dyer Construction Co.', NULL, NULL, '2025-06-15T09:00:00Z'),
('cust-039', 'Paldamas Construction', NULL, NULL, '2025-07-01T08:00:00Z'),
('cust-040', 'Barton Supply', NULL, NULL, '2025-08-01T10:00:00Z');
-- ─── Vendors (from Vendors698.csv) ───
INSERT OR IGNORE INTO vendors (id, name, category, email, phone, address, created_at) VALUES
('vend-001', '1st Priority Home Improvements LLC', 'Subcontractor', '1stpriorityhomeimprovement@gmail.com', NULL, '2928 Main St. Apt 101, Colorado Springs, CO 80907', '2023-07-16T20:26:00Z'),
('vend-002', 'Advantage Tile Work Inc.', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-003', 'Apex Radon', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-004', 'Christensen Construction Co. Inc.', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-005', 'Kilgore Companies dba Peak Ready Mix', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-006', 'Smelker Concrete Pumping Inc.', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-007', 'Simpson Strong-Tie Co Inc', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-008', 'Florissant ACE Hardware', 'Supplier', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-009', 'A-Mark Stamp/Budget Sign', 'Supplier', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-010', 'Aggregate Ind dba Transit Mix Concrete Co.', 'Supplier', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-011', 'Airlite Plastics Co.', 'Supplier', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-012', 'Apex Waste - Teller County', 'Supplier', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-013', 'Digital River', 'Supplier', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-014', 'Divide Feed', 'Supplier', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-015', 'Hardrick Enterprises', 'Supplier', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-016', 'MacArthur Co.', 'Supplier', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-017', 'Colorado Geoscience & Design', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-018', 'Hamacher Well Works', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-019', 'H2Air of Colorado', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-020', 'TK Concrete Lifting', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-021', 'Mule Creek Gravel', 'Supplier', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-022', 'BURNCO Colorado', 'Supplier', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-023', 'Agate Services', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-024', 'JDM Consulting', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z'),
('vend-025', 'Teds Plumbing', 'Subcontractor', NULL, NULL, NULL, '2023-07-16T20:26:00Z');
-- ─── Projects (realistic HPS projects using customer names) ───
INSERT OR IGNORE INTO projects (id, name, status, address, client_name, project_manager, created_at) VALUES
('proj-o-001', 'O-001-5678-Williams', 'ACTIVE', '5678 Pine Ridge Dr, Woodland Park, CO', 'Matt B Willson', 'Daniel M Vogel', '2025-07-10T08:00:00Z'),
('proj-o-002', 'O-002-9012-Chen', 'ACTIVE', '9012 Elk Creek Rd, Divide, CO', 'Sandra Coen', 'Daniel M Vogel', '2025-09-20T09:00:00Z'),
('proj-o-003', 'O-003-3456-Taylor', 'OPEN', '3456 Mountain View Ln, Florissant, CO', 'Gerald and Kristi Taylor', 'Wesley Jones', '2025-11-05T10:00:00Z'),
('proj-o-004', 'O-004-7890-Hinson', 'ACTIVE', '7890 Sunset Trail, Cripple Creek, CO', 'Keith & Jennifer Hinson', 'Daniel M Vogel', '2025-12-01T08:00:00Z'),
('proj-o-005', 'O-005-2345-Loomis', 'OPEN', '2345 Aspen Grove Way, Woodland Park, CO', 'Travis and Tanis Loomis', 'Wesley Jones', '2026-01-10T09:00:00Z'),
('proj-n-001', 'N-001-1234-Johnson', 'ACTIVE', '1234 Gold Camp Rd, Colorado Springs, CO', 'James McGorry', 'Daniel M Vogel', '2025-08-15T09:00:00Z'),
('proj-n-002', 'N-002-5600-Martinez', 'COMPLETE', '5600 Ute Pass Ave, Cascade, CO', 'Justin Rapp', 'Wesley Jones', '2025-03-01T08:00:00Z'),
('proj-n-003', 'N-003-8800-Kelsey', 'ACTIVE', '8800 Rampart Range Rd, Woodland Park, CO', 'Robert Kelsey', 'Daniel M Vogel', '2025-10-15T10:00:00Z'),
('proj-n-004', 'N-004-4200-Auger', 'OPEN', '4200 Teller County Rd, Florissant, CO', 'Chris Auger', 'Wesley Jones', '2026-01-05T08:00:00Z'),
('proj-n-005', 'N-005-6100-Clifford', 'ACTIVE', '6100 High Park Rd, Cripple Creek, CO', 'Joseph Clifford', 'Daniel M Vogel', '2025-11-20T09:00:00Z');

View File

@ -7,6 +7,10 @@ import {
export const projects = sqliteTable("projects", {
id: text("id").primaryKey(),
name: text("name").notNull(),
status: text("status").notNull().default("OPEN"),
address: text("address"),
clientName: text("client_name"),
projectManager: text("project_manager"),
createdAt: text("created_at").notNull(),
})
@ -72,6 +76,24 @@ export const scheduleBaselines = sqliteTable("schedule_baselines", {
createdAt: text("created_at").notNull(),
})
export const customers = sqliteTable("customers", {
id: text("id").primaryKey(),
name: text("name").notNull(),
email: text("email"),
phone: text("phone"),
createdAt: text("created_at").notNull(),
})
export const vendors = sqliteTable("vendors", {
id: text("id").primaryKey(),
name: text("name").notNull(),
category: text("category").notNull().default("Subcontractor"),
email: text("email"),
phone: text("phone"),
address: text("address"),
createdAt: text("created_at").notNull(),
})
export type Project = typeof projects.$inferSelect
export type ScheduleTask = typeof scheduleTasks.$inferSelect
export type NewScheduleTask = typeof scheduleTasks.$inferInsert
@ -81,3 +103,7 @@ export type WorkdayException = typeof workdayExceptions.$inferSelect
export type NewWorkdayException = typeof workdayExceptions.$inferInsert
export type ScheduleBaseline = typeof scheduleBaselines.$inferSelect
export type NewScheduleBaseline = typeof scheduleBaselines.$inferInsert
export type Customer = typeof customers.$inferSelect
export type NewCustomer = typeof customers.$inferInsert
export type Vendor = typeof vendors.$inferSelect
export type NewVendor = typeof vendors.$inferInsert