c7b9e6ac51
support belongs to field in view collection
21 lines
539 B
TypeScript
21 lines
539 B
TypeScript
import { Collection, CollectionContext, CollectionOptions } from './collection';
|
|
|
|
export class ViewCollection extends Collection {
|
|
constructor(options: CollectionOptions, context: CollectionContext) {
|
|
options.autoGenId = false;
|
|
options.timestamps = false;
|
|
|
|
super(options, context);
|
|
}
|
|
|
|
protected sequelizeModelOptions(): any {
|
|
const modelOptions = super.sequelizeModelOptions();
|
|
modelOptions.tableName = this.options.viewName || this.options.name;
|
|
return modelOptions;
|
|
}
|
|
|
|
isView() {
|
|
return true;
|
|
}
|
|
}
|