Skip to content

Commit 710cb8b

Browse files
authored
chore: minor fixes (#421)
1 parent fcd5573 commit 710cb8b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/auth-adapters/better-auth/src/schema-generator.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export async function generateSchema(
4444
}
4545
}
4646

47-
const schemaExists = !!(filePath && fs.existsSync(filePath));
47+
const schemaExists = fs.existsSync(filePath);
4848

4949
const schema = await updateSchema(filePath, tables, config, options);
5050

@@ -161,22 +161,22 @@ function createDataModel(modelName: string, zmodel: Model, numericId: boolean) {
161161
}
162162

163163
function addModelField(dataModel: DataModel, fieldName: string, fieldType: string, array: boolean, optional: boolean) {
164-
const idField: DataField = {
164+
const field: DataField = {
165165
$type: 'DataField',
166166
name: fieldName,
167167
attributes: [],
168168
comments: [],
169169
$container: dataModel,
170170
} as any;
171-
idField.type = {
171+
field.type = {
172172
$type: 'DataFieldType',
173173
type: fieldType as any,
174174
array,
175175
optional,
176-
$container: idField,
176+
$container: field,
177177
};
178-
dataModel.fields.push(idField);
179-
return idField;
178+
dataModel.fields.push(field);
179+
return field;
180180
}
181181

182182
function initializeZmodel(config: AdapterConfig) {
@@ -340,7 +340,7 @@ function addOrUpdateModel(
340340
addDefaultNow(df);
341341
} else {
342342
console.warn(
343-
`Warning: Unsupported default function for field ${fieldName} in model ${fName}. Please adjust manually.`,
343+
`Warning: Unsupported default function for field ${fieldName} in model ${table.modelName}. Please adjust manually.`,
344344
);
345345
}
346346
}

packages/cli/src/actions/action-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function getSchemaFile(file?: string) {
3636
return './zenstack/schema.zmodel';
3737
} else {
3838
throw new CliError(
39-
'Schema file not found in default locations ("./zenstack/schema.zmodel" or "./schema.zmodel").',
39+
'Schema file not found in default locations ("./schema.zmodel" or "./zenstack/schema.zmodel").',
4040
);
4141
}
4242
}

0 commit comments

Comments
 (0)