相关疑难解决方法(0)

如何使学说支持时间戳列?

我正在尝试应用以下迁移:

Schema::table('users', function (Blueprint $table) {
    $table->timestamp('created_at')->useCurrent()->change();
});
Run Code Online (Sandbox Code Playgroud)

但是artisan说:

  [Doctrine\DBAL\DBALException]
  Unknown column type "timestamp" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL
  \Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypesMap(). I
  f this error occurs during database introspection then you might have forgot to register all database types for a
  Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#getMapp
  edDatabaseTypes(). If the type name is empty …
Run Code Online (Sandbox Code Playgroud)

php database-migration doctrine-orm sql-timestamp laravel-5.2

4
推荐指数
3
解决办法
4975
查看次数