refactor: remove limitRollback from application settings and related UI components

- Eliminated the "limitRollback" property from the application schema and the ShowRollbackSettings component, streamlining rollback configuration.
- Updated the database schema to drop the "limitRollback" column from the "application" table, ensuring consistency across the application.
This commit is contained in:
Mauricio Siu
2025-06-08 16:53:23 -06:00
parent cf06e5369a
commit ef0cef99a1
5 changed files with 5814 additions and 26 deletions

View File

@@ -14,9 +14,7 @@ import {
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { zodResolver } from "@hookform/resolvers/zod";
@@ -55,7 +53,6 @@ export const ShowRollbackSettings = ({ applicationId, children }: Props) => {
resolver: zodResolver(formSchema),
defaultValues: {
rollbackActive: application?.rollbackActive ?? false,
limitRollback: application?.limitRollback ?? 5,
},
});
@@ -63,7 +60,6 @@ export const ShowRollbackSettings = ({ applicationId, children }: Props) => {
await updateApplication({
applicationId,
rollbackActive: data.rollbackActive,
limitRollback: data.limitRollback,
})
.then(() => {
toast.success("Rollback settings updated");
@@ -111,27 +107,6 @@ export const ShowRollbackSettings = ({ applicationId, children }: Props) => {
)}
/>
<FormField
control={form.control}
name="limitRollback"
render={({ field }) => (
<FormItem>
<FormLabel>Maximum Rollbacks</FormLabel>
<FormControl>
<Input
type="number"
{...field}
onChange={(e) => field.onChange(Number(e.target.value))}
/>
</FormControl>
<FormDescription>
Number of rollback points to maintain (1-50)
</FormDescription>
<FormMessage />
</FormItem>
)}
/>
<Button type="submit" className="w-full" isLoading={isLoading}>
Save Settings
</Button>

View File

@@ -0,0 +1 @@
ALTER TABLE "application" DROP COLUMN "limitRollback";

File diff suppressed because it is too large Load Diff

View File

@@ -666,6 +666,13 @@
"when": 1748918922255,
"tag": "0094_true_marvel_zombies",
"breakpoints": true
},
{
"idx": 95,
"version": "7",
"when": 1748931222940,
"tag": "0095_sweet_venom",
"breakpoints": true
}
]
}

View File

@@ -132,7 +132,6 @@ export const applications = pgTable("application", {
false,
),
rollbackActive: boolean("rollbackActive").default(false),
limitRollback: integer("limitRollback").default(5),
buildArgs: text("buildArgs"),
memoryReservation: text("memoryReservation"),
memoryLimit: text("memoryLimit"),