mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-27 01:16:55 -05:00
chore:lint
This commit is contained in:
@@ -20,7 +20,9 @@ export const generateDrizzleSchema: SchemaGenerator = async ({
|
||||
const fileExist = existsSync(filePath);
|
||||
|
||||
for (const table in tables) {
|
||||
const modelName = usePlural ? `${tables[table].modelName}s` : tables[table].modelName;
|
||||
const modelName = usePlural
|
||||
? `${tables[table].modelName}s`
|
||||
: tables[table].modelName;
|
||||
const fields = tables[table].fields;
|
||||
function getType(name: string, type: FieldType) {
|
||||
if (type === "string") {
|
||||
@@ -55,7 +57,11 @@ export const generateDrizzleSchema: SchemaGenerator = async ({
|
||||
attr.required ? ".notNull()" : ""
|
||||
}${attr.unique ? ".unique()" : ""}${
|
||||
attr.references
|
||||
? `.references(()=> ${usePlural ? `${attr.references.model}s` : attr.references.model}.${attr.references.field})`
|
||||
? `.references(()=> ${
|
||||
usePlural
|
||||
? `${attr.references.model}s`
|
||||
: attr.references.model
|
||||
}.${attr.references.field})`
|
||||
: ""
|
||||
}`;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user