Import other modules into monorepo
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2021-06-01 20:59:40 -05:00
parent 26d54033af
commit 9be9c44a32
138 changed files with 11544 additions and 139 deletions

30
src/orm/template/model.ts Normal file
View File

@@ -0,0 +1,30 @@
import {Template} from "../../cli"
import {UniversalPath} from "../../util"
/**
* Template for creating new database model classes in app/models.
*/
const model_template: Template = {
name: 'model',
fileSuffix: '.model.ts',
baseAppPath: ['models'],
description: 'Create a new class that represents a record in a database',
render: (name: string, fullCanonicalName: string, targetFilePath: UniversalPath) => {
return `import {Model} from "@extollo/orm"
import {Injectable} from "@extollo/di"
/**
* ${name} Model
* -----------------------------------
* Put some description here.
*/
@Injectable()
export class ${name} extends Model<${name}> {
protected static table = '${name.toLowerCase()}';
protected static key = '${name.toLowerCase()}_id';
}
`
}
}
export { model_template }