Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/auth-adapters/better-auth/src/schema-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export async function generateSchema(
}
}

const schemaExists = !!(filePath && fs.existsSync(filePath));
const schemaExists = fs.existsSync(filePath);

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

Expand Down Expand Up @@ -161,22 +161,22 @@ function createDataModel(modelName: string, zmodel: Model, numericId: boolean) {
}

function addModelField(dataModel: DataModel, fieldName: string, fieldType: string, array: boolean, optional: boolean) {
const idField: DataField = {
const field: DataField = {
$type: 'DataField',
name: fieldName,
attributes: [],
comments: [],
$container: dataModel,
} as any;
idField.type = {
field.type = {
$type: 'DataFieldType',
type: fieldType as any,
array,
optional,
$container: idField,
$container: field,
};
dataModel.fields.push(idField);
return idField;
dataModel.fields.push(field);
return field;
}

function initializeZmodel(config: AdapterConfig) {
Expand Down Expand Up @@ -340,7 +340,7 @@ function addOrUpdateModel(
addDefaultNow(df);
} else {
console.warn(
`Warning: Unsupported default function for field ${fieldName} in model ${fName}. Please adjust manually.`,
`Warning: Unsupported default function for field ${fieldName} in model ${table.modelName}. Please adjust manually.`,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/actions/action-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function getSchemaFile(file?: string) {
return './zenstack/schema.zmodel';
} else {
throw new CliError(
'Schema file not found in default locations ("./zenstack/schema.zmodel" or "./schema.zmodel").',
'Schema file not found in default locations ("./schema.zmodel" or "./zenstack/schema.zmodel").',
);
}
}
Expand Down
Loading