createTable('Notificacion', [ 'id' => $this->primaryKey(), 'envio' => $this->timestamp().' with time zone', 'estatus' => $this->string(10), 'creado' => $this->timestamp().' with time zone', 'modificado' => $this->timestamp().' with time zone', 'detalle' => $this->json() ]); $this->createTable('NotificacionUsuario', [ 'id' => $this->primaryKey(), 'idNotificacion' => $this->integer(), 'idUsuario' => $this->integer(), 'nombre' => $this->string(100), 'telefono' => $this->string(10), 'parametros' => $this->json(), 'detalle' => $this->json() ]); $this->addForeignKey('NotificacionUsuario_idNotificacion_FK', 'NotificacionUsuario', 'idNotificacion', 'Notificacion', 'id'); $this->addForeignKey('NotificacionUsuario_idUsuario_FK', 'NotificacionUsuario', 'idUsuario', 'Usuario', 'id'); } /** * {@inheritdoc} */ public function safeDown() { $this->dropForeignKey('NotificacionUsuario_idUsuario_FK', 'NotificacionUsuario'); $this->dropForeignKey('NotificacionUsuario_idNotificacion_FK', 'NotificacionUsuario'); $this->dropTable('NotificacionUsuario'); $this->dropTable('Notificacion'); } }