fix migrations

This commit is contained in:
bkellam 2025-09-20 16:27:15 -07:00
parent 46084c3a07
commit 8a51fe7d23
3 changed files with 24 additions and 31 deletions

View file

@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "Repo" ADD COLUMN "isPublic" BOOLEAN;

View file

@ -5,7 +5,8 @@ CREATE TYPE "RepoPermissionSyncJobStatus" AS ENUM ('PENDING', 'IN_PROGRESS', 'CO
CREATE TYPE "UserPermissionSyncJobStatus" AS ENUM ('PENDING', 'IN_PROGRESS', 'COMPLETED', 'FAILED'); CREATE TYPE "UserPermissionSyncJobStatus" AS ENUM ('PENDING', 'IN_PROGRESS', 'COMPLETED', 'FAILED');
-- AlterTable -- AlterTable
ALTER TABLE "Repo" ADD COLUMN "permissionSyncedAt" TIMESTAMP(3); ALTER TABLE "Repo" ADD COLUMN "isPublic" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "permissionSyncedAt" TIMESTAMP(3);
-- AlterTable -- AlterTable
ALTER TABLE "User" ADD COLUMN "permissionSyncedAt" TIMESTAMP(3); ALTER TABLE "User" ADD COLUMN "permissionSyncedAt" TIMESTAMP(3);

View file

@ -42,34 +42,28 @@ enum ChatVisibility {
model Repo { model Repo {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
name String // Full repo name, including the vcs hostname (ex. github.com/sourcebot-dev/sourcebot) name String /// Full repo name, including the vcs hostname (ex. github.com/sourcebot-dev/sourcebot)
displayName String? // Display name of the repo for UI (ex. sourcebot-dev/sourcebot) displayName String? /// Display name of the repo for UI (ex. sourcebot-dev/sourcebot)
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
indexedAt DateTime? /// When the repo was last indexed successfully.
/// When the repo was last indexed successfully.
indexedAt DateTime?
isFork Boolean isFork Boolean
isArchived Boolean isArchived Boolean
isPublic Boolean? isPublic Boolean @default(false)
metadata Json // For schema see repoMetadataSchema in packages/backend/src/types.ts metadata Json /// For schema see repoMetadataSchema in packages/backend/src/types.ts
cloneUrl String cloneUrl String
webUrl String? webUrl String?
connections RepoToConnection[] connections RepoToConnection[]
imageUrl String? imageUrl String?
repoIndexingStatus RepoIndexingStatus @default(NEW) repoIndexingStatus RepoIndexingStatus @default(NEW)
permittedUsers UserToRepoPermission[] permittedUsers UserToRepoPermission[]
permissionSyncJobs RepoPermissionSyncJob[] permissionSyncJobs RepoPermissionSyncJob[]
/// When the permissions were last synced successfully. permissionSyncedAt DateTime? /// When the permissions were last synced successfully.
permissionSyncedAt DateTime?
// The id of the repo in the external service external_id String /// The id of the repo in the external service
external_id String external_codeHostType String /// The type of the external service (e.g., github, gitlab, etc.)
// The type of the external service (e.g., github, gitlab, etc.) external_codeHostUrl String /// The base url of the external service (e.g., https://github.com)
external_codeHostType String
// The base url of the external service (e.g., https://github.com)
external_codeHostUrl String
org Org @relation(fields: [orgId], references: [id], onDelete: Cascade) org Org @relation(fields: [orgId], references: [id], onDelete: Cascade)
orgId Int orgId Int