feat: implement rollback functionality with UI components and database schema updates

- Added ShowEnv and ShowRollbackSettings components for displaying and configuring rollback settings.
- Implemented ShowRollbacks component to list and manage rollbacks for applications.
- Created rollback database schema and updated application schema to include rollback settings.
- Added API routes for managing rollbacks, including fetching, creating, and deleting rollbacks.
- Integrated rollback functionality into the application deployment process.
This commit is contained in:
Mauricio Siu
2025-05-10 20:28:34 -06:00
parent aa475e6123
commit 2ad8bf355b
17 changed files with 12317 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ import { server } from "./server";
import { applicationStatus, certificateType, triggerType } from "./shared";
import { sshKeys } from "./ssh-key";
import { generateAppName } from "./utils";
import { rollbacks } from "./rollbacks";
export const sourceType = pgEnum("sourceType", [
"docker",
"git",
@@ -132,6 +132,8 @@ export const applications = pgTable("application", {
isPreviewDeploymentsActive: boolean("isPreviewDeploymentsActive").default(
false,
),
rollbackActive: boolean("rollbackActive").default(false),
limitRollback: integer("limitRollback").default(5),
buildArgs: text("buildArgs"),
memoryReservation: text("memoryReservation"),
memoryLimit: text("memoryLimit"),
@@ -274,6 +276,7 @@ export const applicationsRelations = relations(
references: [server.serverId],
}),
previewDeployments: many(previewDeployments),
rollbacks: many(rollbacks),
}),
);