Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
249c68afa6 | ||
|
e51a2e587f | ||
|
74be5631f6 | ||
|
61a39768fe | ||
|
b1fdd92583 | ||
|
47663de08f |
@ -89,7 +89,7 @@ export default function modelCustomizationPhase(
|
||||
}
|
||||
namingStrategy.enablePluralization(generationOptions.pluralizeNames);
|
||||
let retVal = removeIndicesGeneratedByTypeorm(dbModel);
|
||||
retVal = removeColumnsInRelation(dbModel);
|
||||
//retVal = removeColumnsInRelation(dbModel);
|
||||
retVal = applyNamingStrategy(namingStrategy, dbModel);
|
||||
retVal = addImportsAndGenerationOptions(retVal, generationOptions);
|
||||
retVal = removeColumnDefaultProperties(retVal, defaultValues);
|
||||
|
@ -12,6 +12,9 @@ import { Relation } from "./models/Relation";
|
||||
const prettierOptions: Prettier.Options = {
|
||||
parser: "typescript",
|
||||
endOfLine: "auto",
|
||||
singleQuote: true,
|
||||
trailingComma: "all",
|
||||
printWidth: 1000,
|
||||
};
|
||||
|
||||
export default function modelGenerationPhase(
|
||||
|
@ -67,7 +67,7 @@ export function relationName(relation: Relation, owner?: Entity): string {
|
||||
}
|
||||
|
||||
export function entityName(oldEntityName: string, entity?: Entity): string {
|
||||
return oldEntityName;
|
||||
return oldEntityName + "Entity";
|
||||
}
|
||||
|
||||
export function columnName(oldColumnName: string, column?: Column): string {
|
||||
@ -75,5 +75,5 @@ export function columnName(oldColumnName: string, column?: Column): string {
|
||||
}
|
||||
|
||||
export function fileName(oldFileName: string): string {
|
||||
return oldFileName;
|
||||
return oldFileName.replace("Entity", ".entity");
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ export default class MssqlDriver extends AbstractDriver {
|
||||
records.forEach((record) => {
|
||||
indexInfo.columns.push(record.ColumnName);
|
||||
});
|
||||
ent.indices.push(indexInfo);
|
||||
if (indexInfo.primary) ent.indices.push(indexInfo);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -35,7 +35,17 @@ import {{localImport (toEntityName entityName)}} from './{{toFileName fileName}}
|
||||
@Entity("{{sqlName}}"{{#schema}} ,{schema:"{{.}}"{{#if ../database}}, database:"{{../database}}"{{/if}} } {{/schema}})
|
||||
export {{defaultExport}} class {{toEntityName tscName}}{{#activeRecord}} extends BaseEntity{{/activeRecord}} {
|
||||
|
||||
{{#if columns}}
|
||||
|
||||
// Columns
|
||||
|
||||
{{/if~}}
|
||||
{{#columns}}{{> Column}}{{/columns~}}
|
||||
{{#if relations}}
|
||||
|
||||
// Relations
|
||||
|
||||
{{/if~}}
|
||||
{{#relations}}{{> Relation}}{{/relations~}}
|
||||
{{#relationIds}}{{> RelationId entityName=../tscName}}{{/relationIds~}}
|
||||
{{#if generateConstructor}}{{>Constructor entityName=tscName}}{{/if~}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{#entities~}}
|
||||
import {{localImport (toEntityName tscName)}} from './{{toFileName tscName}}'
|
||||
import {{localImport (toEntityName tscName)}} from './{{toFileName fileName}}'
|
||||
{{/entities}}
|
||||
|
||||
export { {{#entities}}{{toEntityName tscName}},{{/entities~}} }
|
||||
|
Loading…
Reference in New Issue
Block a user