File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { Application } from 'egg';
5
5
export default function ( app : Application ) {
6
6
const { STRING , INTEGER , DATE } = app . Sequelize ;
7
7
8
- const Post = app . model . define ( 'post' , {
8
+ const Model = app . model . define ( 'post' , {
9
9
id : {
10
10
type : INTEGER ,
11
11
primaryKey : true ,
@@ -18,7 +18,7 @@ export default function(app: Application) {
18
18
updated_at : DATE ( 6 ) ,
19
19
} ) ;
20
20
21
- return class extends Post {
21
+ return class Post extends Model {
22
22
static associate ( ) {
23
23
app . model . Post . belongsTo ( app . model . User , { as : 'user' , foreignKey : 'user_id' } ) ;
24
24
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Application } from 'egg';
4
4
5
5
export default function ( app : Application ) {
6
6
const { STRING , INTEGER , DATE } = app . Sequelize ;
7
- const User = app . model . define ( 'user' , {
7
+ const Model = app . model . define ( 'user' , {
8
8
id : {
9
9
type : INTEGER ,
10
10
primaryKey : true ,
@@ -16,7 +16,7 @@ export default function(app: Application) {
16
16
updated_at : DATE ( 6 ) ,
17
17
} ) ;
18
18
19
- return class extends User {
19
+ return class User extends Model {
20
20
static associate ( ) {
21
21
app . model . User . hasMany ( app . model . Post , { as : 'posts' } ) ;
22
22
}
You can’t perform that action at this time.
0 commit comments