@@ -24,15 +24,15 @@ |
||
| 24 | 24 | } |
| 25 | 25 | // https://segmentfault.com/q/1010000000672529/a-1020000000679702 |
| 26 | 26 | $this->createTable($this->tableName, [ |
| 27 | - 'id' => $this->char(36)->notNull()->unique()->comment('Id'),//通知ID |
|
| 28 | - 'verb' => $this->string(32),//执行了什么操作 |
|
| 29 | - 'template' => $this->string(),//模板 |
|
| 30 | - 'notifiable_id' => $this->unsignedInteger()->notNull()->comment('Entity'),//通知实体ID |
|
| 31 | - 'notifiable_class' => $this->string()->notNull()->comment('Entity'),//通知实体类名 |
|
| 32 | - 'data' => $this->text(),//通知数据 |
|
| 33 | - 'read_at' => $this->unixTimestamp()->comment('Read At'),//阅读时间 |
|
| 34 | - 'created_at' => $this->unixTimestamp()->notNull()->comment('Created At'),//创建时间 |
|
| 35 | - 'updated_at' => $this->integer(10)->unsigned()->notNull()->comment('Updated At'),//更新时间 |
|
| 27 | + 'id' => $this->char(36)->notNull()->unique()->comment('Id'), //通知ID |
|
| 28 | + 'verb' => $this->string(32), //执行了什么操作 |
|
| 29 | + 'template' => $this->string(), //模板 |
|
| 30 | + 'notifiable_id' => $this->unsignedInteger()->notNull()->comment('Entity'), //通知实体ID |
|
| 31 | + 'notifiable_class' => $this->string()->notNull()->comment('Entity'), //通知实体类名 |
|
| 32 | + 'data' => $this->text(), //通知数据 |
|
| 33 | + 'read_at' => $this->unixTimestamp()->comment('Read At'), //阅读时间 |
|
| 34 | + 'created_at' => $this->unixTimestamp()->notNull()->comment('Created At'), //创建时间 |
|
| 35 | + 'updated_at' => $this->integer(10)->unsigned()->notNull()->comment('Updated At'), //更新时间 |
|
| 36 | 36 | ], $tableOptions); |
| 37 | 37 | $this->createIndex('notification_notifiable', $this->tableName, ['notifiable_id', 'notifiable_class']); |
| 38 | 38 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | public function rules() |
| 55 | 55 | { |
| 56 | 56 | return [ |
| 57 | - [['id','template', 'notifiable_id', 'notifiable_class'], 'required'], |
|
| 57 | + [['id', 'template', 'notifiable_id', 'notifiable_class'], 'required'], |
|
| 58 | 58 | [['notifiable_id', 'read_at'], 'integer'], |
| 59 | 59 | [['id'], 'string', 'max' => 36], |
| 60 | 60 | [['verb'], 'string', 'max' => 32], |