File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 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';
55export default function ( app : Application ) {
66 const { STRING , INTEGER , DATE } = app . Sequelize ;
77
8- const Post = app . model . define ( 'post' , {
8+ const Model = app . model . define ( 'post' , {
99 id : {
1010 type : INTEGER ,
1111 primaryKey : true ,
@@ -18,7 +18,7 @@ export default function(app: Application) {
1818 updated_at : DATE ( 6 ) ,
1919 } ) ;
2020
21- return class extends Post {
21+ return class Post extends Model {
2222 static associate ( ) {
2323 app . model . Post . belongsTo ( app . model . User , { as : 'user' , foreignKey : 'user_id' } ) ;
2424 }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Application } from 'egg';
44
55export default function ( app : Application ) {
66 const { STRING , INTEGER , DATE } = app . Sequelize ;
7- const User = app . model . define ( 'user' , {
7+ const Model = app . model . define ( 'user' , {
88 id : {
99 type : INTEGER ,
1010 primaryKey : true ,
@@ -16,7 +16,7 @@ export default function(app: Application) {
1616 updated_at : DATE ( 6 ) ,
1717 } ) ;
1818
19- return class extends User {
19+ return class User extends Model {
2020 static associate ( ) {
2121 app . model . User . hasMany ( app . model . Post , { as : 'posts' } ) ;
2222 }
You can’t perform that action at this time.
0 commit comments