increase name sizes

This commit is contained in:
x032205
2025-05-21 02:36:10 -04:00
parent 4292cb2a04
commit 38bf5e8b1d
6 changed files with 27 additions and 5 deletions
@@ -0,0 +1,22 @@
import { Knex } from "knex";
import { TableName } from "../schemas";
export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable(TableName.SecretSync, (t) => {
t.string("name", 64).notNullable().alter();
});
await knex.schema.alterTable(TableName.ProjectTemplates, (t) => {
t.string("name", 64).notNullable().alter();
});
await knex.schema.alterTable(TableName.AppConnection, (t) => {
t.string("name", 64).notNullable().alter();
});
await knex.schema.alterTable(TableName.SecretRotationV2, (t) => {
t.string("name", 64).notNullable().alter();
});
}
export async function down(): Promise<void> {
// No down migration or it will error
}
+1 -1
View File
@@ -9,7 +9,7 @@ interface SlugSchemaInputs {
field?: string; field?: string;
} }
export const slugSchema = ({ min = 1, max = 32, field = "Slug" }: SlugSchemaInputs = {}) => { export const slugSchema = ({ min = 1, max = 64, field = "Slug" }: SlugSchemaInputs = {}) => {
return z return z
.string() .string()
.trim() .trim()
@@ -32,7 +32,7 @@ const formSchema = z.object({
environments: z environments: z
.object({ .object({
name: z.string().trim().min(1), name: z.string().trim().min(1),
slug: slugSchema({ min: 1, max: 32 }) slug: slugSchema({ min: 1, max: 64 })
}) })
.array() .array()
.nullish() .nullish()
@@ -21,7 +21,7 @@ import {
import { slugSchema } from "@app/lib/schemas"; import { slugSchema } from "@app/lib/schemas";
const formSchema = z.object({ const formSchema = z.object({
name: slugSchema({ min: 1, max: 32, field: "Name" }), name: slugSchema({ min: 1, max: 64, field: "Name" }),
description: z.string().max(500).optional() description: z.string().max(500).optional()
}); });
+1 -1
View File
@@ -7,7 +7,7 @@ interface SlugSchemaInputs {
field?: string; field?: string;
} }
export const slugSchema = ({ min = 1, max = 32, field = "Slug" }: SlugSchemaInputs = {}) => { export const slugSchema = ({ min = 1, max = 64, field = "Slug" }: SlugSchemaInputs = {}) => {
return z return z
.string() .string()
.trim() .trim()
@@ -5,7 +5,7 @@ import { FormControl, Input, TextArea } from "@app/components/v2";
import { slugSchema } from "@app/lib/schemas"; import { slugSchema } from "@app/lib/schemas";
export const genericAppConnectionFieldsSchema = z.object({ export const genericAppConnectionFieldsSchema = z.object({
name: slugSchema({ min: 1, max: 32, field: "Name" }), name: slugSchema({ min: 1, max: 64, field: "Name" }),
description: z.string().trim().max(256, "Description cannot exceed 256 characters").nullish() description: z.string().trim().max(256, "Description cannot exceed 256 characters").nullish()
}); });