Integrate multer and adm-zip for handling file uploads and zip extraction. Add API endpoints for fetching, searching, and uploading files. Update storage interface and schema to support project files. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: fadde5c0-d787-4605-8d47-ab3e7884f567 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/c9ITWqD
23 lines
788 B
TypeScript
23 lines
788 B
TypeScript
import { pgTable, text, varchar, integer, timestamp } from "drizzle-orm/pg-core";
|
|
import { createInsertSchema } from "drizzle-zod";
|
|
import { z } from "zod";
|
|
|
|
export const projectFiles = pgTable("project_files", {
|
|
id: varchar("id").primaryKey(),
|
|
filename: text("filename").notNull(),
|
|
filepath: text("filepath").notNull(),
|
|
fileType: text("file_type").notNull(),
|
|
size: integer("size").notNull(),
|
|
content: text("content"),
|
|
category: text("category").notNull(),
|
|
uploadedAt: timestamp("uploaded_at").defaultNow().notNull(),
|
|
});
|
|
|
|
export const insertProjectFileSchema = createInsertSchema(projectFiles).omit({
|
|
id: true,
|
|
uploadedAt: true,
|
|
});
|
|
|
|
export type InsertProjectFile = z.infer<typeof insertProjectFileSchema>;
|
|
export type ProjectFile = typeof projectFiles.$inferSelect;
|