CREATE TABLE `projects` (
	`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
	`customer_name` text,
	`customer_base` text,
	`project_name` text,
	`product_name` text,
	`factory_location` text,
	`mold_count` text,
	`part_number` text,
	`cavity_number` text,
	`mold_id` text,
	`pm_name` text,
	`pe_name` text,
	`mold_lead` text,
	`pqe_name` text,
	`risk_level` text,
	`kickoff_date` text,
	`t1_date` text,
	`gl_date` text,
	`vmp_date` text,
	`mp_date` text,
	`current_stage` text,
	`t1_dimension_ok` text,
	`trial_count` text,
	`tooling_fai` text,
	`part_fai` text,
	`current_node` text,
	`progress_details` text,
	`update_date` text,
	`created_at` integer NOT NULL,
	`updated_at` integer NOT NULL,
	`created_by` integer,
	FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `users` (
	`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
	`openId` text NOT NULL,
	`name` text,
	`email` text,
	`loginMethod` text,
	`role` text DEFAULT 'user' NOT NULL,
	`createdAt` integer NOT NULL,
	`updatedAt` integer NOT NULL,
	`lastSignedIn` integer NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `users_openId_unique` ON `users` (`openId`);