refactor(biome): formats from biome
This commit is contained in:
@@ -1,42 +1,42 @@
|
||||
import {
|
||||
text,
|
||||
pgTable,
|
||||
timestamp,
|
||||
uuid,
|
||||
uniqueIndex,
|
||||
jsonb,
|
||||
boolean,
|
||||
boolean,
|
||||
jsonb,
|
||||
pgTable,
|
||||
text,
|
||||
timestamp,
|
||||
uniqueIndex,
|
||||
uuid,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
export const settings = pgTable(
|
||||
"settings",
|
||||
{
|
||||
settings_id: uuid("settings_id").defaultRandom().primaryKey(),
|
||||
name: text("name").notNull(),
|
||||
value: text("value").notNull(), // this is used in junction with active, only needed if the setting isnt a bool
|
||||
description: text("description"),
|
||||
moduleName: text("moduleName"), // what part of lst dose it belong to this is used to split the settings out later
|
||||
active: boolean("active").default(true),
|
||||
roles: jsonb("roles").notNull().default(["systemAdmin"]), // role or roles to see this goes along with the moduleName, need to have a x role in module to see this setting.
|
||||
add_User: text("add_User").default("LST_System").notNull(),
|
||||
add_Date: timestamp("add_Date").defaultNow(),
|
||||
upd_user: text("upd_User").default("LST_System").notNull(),
|
||||
upd_date: timestamp("upd_date").defaultNow(),
|
||||
},
|
||||
(table) => [
|
||||
// uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`),
|
||||
uniqueIndex("name").on(table.name),
|
||||
]
|
||||
"settings",
|
||||
{
|
||||
settings_id: uuid("settings_id").defaultRandom().primaryKey(),
|
||||
name: text("name").notNull(),
|
||||
value: text("value").notNull(), // this is used in junction with active, only needed if the setting isnt a bool
|
||||
description: text("description"),
|
||||
moduleName: text("moduleName"), // what part of lst dose it belong to this is used to split the settings out later
|
||||
active: boolean("active").default(true),
|
||||
roles: jsonb("roles").notNull().default(["systemAdmin"]), // role or roles to see this goes along with the moduleName, need to have a x role in module to see this setting.
|
||||
add_User: text("add_User").default("LST_System").notNull(),
|
||||
add_Date: timestamp("add_Date").defaultNow(),
|
||||
upd_user: text("upd_User").default("LST_System").notNull(),
|
||||
upd_date: timestamp("upd_date").defaultNow(),
|
||||
},
|
||||
(table) => [
|
||||
// uniqueIndex('emailUniqueIndex').on(sql`lower(${table.email})`),
|
||||
uniqueIndex("name").on(table.name),
|
||||
],
|
||||
);
|
||||
|
||||
export const settingSchema = createSelectSchema(settings);
|
||||
export const newSettingSchema = createInsertSchema(settings, {
|
||||
name: z.string().min(3, {
|
||||
message: "The name of the setting must be longer than 3 letters",
|
||||
}),
|
||||
name: z.string().min(3, {
|
||||
message: "The name of the setting must be longer than 3 letters",
|
||||
}),
|
||||
});
|
||||
|
||||
export type Setting = z.infer<typeof settingSchema>;
|
||||
|
||||
Reference in New Issue
Block a user