14 lines
373 B
TypeScript
14 lines
373 B
TypeScript
|
import path from 'path';
|
||
|
import { Application } from '@nocobase/server';
|
||
|
import { registerModels } from '@nocobase/database';
|
||
|
import * as models from './models';
|
||
|
|
||
|
export default async function (this: Application, options = {}) {
|
||
|
const database = this.database;
|
||
|
registerModels(models);
|
||
|
|
||
|
database.import({
|
||
|
directory: path.resolve(__dirname, 'collections'),
|
||
|
});
|
||
|
}
|