feat(db): update Repository model to add lastPushedAt, isFork, forkedFromRepoId fields@@ -13,6 +13,16 @@ const makeOnPushEvent: ServiceMethodFactory<
return ({ data, message }) => {
message.write("\n");
if (data.packType === GitServer.PackType.RECEIVE) {
+ const receiveBuffer = [] as string[];
+
+ message.stream.on("data", (chunk) => receiveBuffer.push(chunk));
+ message.stream.on("close", () => {
+ console.log(
+ "message.stream::data:",
+ Buffer.from(receiveBuffer.join("")).toString("utf-8")
+ );
+ });
+
// client has done something like "git push"
// it is uploading, we are receiving
console.log("receive-pack");
@@ -0,0 +1,4 @@
+-- AlterTable
+ALTER TABLE "Repository" ADD COLUMN "forkedFromRepoId" TEXT,
+ADD COLUMN "isFork" BOOLEAN NOT NULL DEFAULT false,
+ADD COLUMN "lastPushedAt" TIMESTAMP(3);
@@ -81,6 +81,7 @@ model Repository {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
+ lastPushedAt DateTime?
avatarUri String?
displayName String?
@@ -88,6 +89,8 @@ model Repository {
shortDescription String?
visibility ResourceVisibility @default(PRIVATE)
websiteUrl String?
+ isFork Boolean @default(false)
+ forkedFromRepoId String?
organization Organization @relation("ManyRepositoriesToOneOrganization", fields: [organizationId], references: [id])
organizationId String