feat: add fullContext column to rollback table and update related functionality

- Introduced a new "fullContext" JSONB column in the "rollback" table to store additional context for rollbacks.
- Removed the "env" column from the "rollback" table to streamline data management.
- Updated the rollbacks service to handle the new "fullContext" field during rollback creation.
- Adjusted the application service to eliminate environment variable handling in rollback operations.
This commit is contained in:
Mauricio Siu
2025-06-02 21:02:17 -06:00
parent 4966bbeb73
commit f8baf6fe41
6 changed files with 5836 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
import { relations } from "drizzle-orm";
import { pgTable, serial, text } from "drizzle-orm/pg-core";
import { jsonb, pgTable, serial, text } from "drizzle-orm/pg-core";
import { createInsertSchema } from "drizzle-zod";
import { nanoid } from "nanoid";
import { z } from "zod";
@@ -10,7 +10,6 @@ export const rollbacks = pgTable("rollback", {
.notNull()
.primaryKey()
.$defaultFn(() => nanoid()),
env: text("env"),
deploymentId: text("deploymentId")
.notNull()
.references(() => deployments.deploymentId, {
@@ -21,6 +20,7 @@ export const rollbacks = pgTable("rollback", {
createdAt: text("createdAt")
.notNull()
.$defaultFn(() => new Date().toISOString()),
fullContext: jsonb("fullContext"),
});
export type Rollback = typeof rollbacks.$inferSelect;