mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 15:37:36 +00:00
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;
|
||
|
}
|
||
|
}
|