Skip to content

Commit

Permalink
Fixed camelCasing of schema names in the schema generator
Browse files Browse the repository at this point in the history
  • Loading branch information
rizen committed Apr 4, 2024
1 parent a11a757 commit a8e50be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ outline: deep

## 2024-04-04
* Provided a little more documentation about virtual columns
* Fixed camelCasing of schema names in the schema generator

## 2024-03-16
* Created a function for fetching ving config in `ving/config.mjs`
Expand Down
3 changes: 2 additions & 1 deletion ving/generator/vingschema.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { getContext, renderTemplate, toFile, after, inject } from '@featherscloud/pinion';
import { camelCase } from 'scule';

const schemaTemplate = ({ name }) =>
`import { baseSchemaProps, dbString, zodString, dbEnum, dbBoolean, dbText, zodText, dbRelation, dbDateTime, dbTimestamp, dbInt, dbJson, zodNumber, zodJsonObject } from '../helpers.mjs';
export const ${name.toLowerCase()}Schema = {
export const ${camelCase(name)}Schema = {
kind: '${name}',
tableName: '${name.toLowerCase()}s',
owner: ['$userId', 'admin'],
Expand Down

0 comments on commit a8e50be

Please sign in to comment.