mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 18:30:39 +09:00
Implement execution workspaces and work products
This commit is contained in:
parent
9da5358bb3
commit
920bc4c70f
45 changed files with 9157 additions and 140 deletions
|
|
@ -5,6 +5,7 @@ import {
|
|||
pgTable,
|
||||
text,
|
||||
timestamp,
|
||||
uniqueIndex,
|
||||
uuid,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { companies } from "./companies.js";
|
||||
|
|
@ -17,9 +18,17 @@ export const projectWorkspaces = pgTable(
|
|||
companyId: uuid("company_id").notNull().references(() => companies.id),
|
||||
projectId: uuid("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
||||
name: text("name").notNull(),
|
||||
sourceType: text("source_type").notNull().default("local_path"),
|
||||
cwd: text("cwd"),
|
||||
repoUrl: text("repo_url"),
|
||||
repoRef: text("repo_ref"),
|
||||
defaultRef: text("default_ref"),
|
||||
visibility: text("visibility").notNull().default("default"),
|
||||
setupCommand: text("setup_command"),
|
||||
cleanupCommand: text("cleanup_command"),
|
||||
remoteProvider: text("remote_provider"),
|
||||
remoteWorkspaceRef: text("remote_workspace_ref"),
|
||||
sharedWorkspaceKey: text("shared_workspace_key"),
|
||||
metadata: jsonb("metadata").$type<Record<string, unknown>>(),
|
||||
isPrimary: boolean("is_primary").notNull().default(false),
|
||||
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
||||
|
|
@ -28,5 +37,9 @@ export const projectWorkspaces = pgTable(
|
|||
(table) => ({
|
||||
companyProjectIdx: index("project_workspaces_company_project_idx").on(table.companyId, table.projectId),
|
||||
projectPrimaryIdx: index("project_workspaces_project_primary_idx").on(table.projectId, table.isPrimary),
|
||||
projectSourceTypeIdx: index("project_workspaces_project_source_type_idx").on(table.projectId, table.sourceType),
|
||||
companySharedKeyIdx: index("project_workspaces_company_shared_key_idx").on(table.companyId, table.sharedWorkspaceKey),
|
||||
projectRemoteRefIdx: uniqueIndex("project_workspaces_project_remote_ref_idx")
|
||||
.on(table.projectId, table.remoteProvider, table.remoteWorkspaceRef),
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue