php – Laravel4迁移列类型的出生日期
发布时间:2020-12-14 19:44:07 所属栏目:大数据 来源:网络整理
导读:我是laravel的新手.所以这将是一个非常基本的问题.我的问题是迁移中的列类型应该是什么,以创建出生日期列.例如,我已经为献血创建了一个迁移文件,其中列是这样的, $table-increments('id'); $table-unsignedInteger('donner_id'); $table-foreign('donner_id'
我是laravel的新手.所以这将是一个非常基本的问题.我的问题是迁移中的列类型应该是什么,以创建出生日期列.例如,我已经为献血创建了一个迁移文件,其中列是这样的,
$table->increments('id'); $table->unsignedInteger('donner_id'); $table->foreign('donner_id')->references->('id')->on('users')->onDelete('cascade')->onUpdate('cascade'); $table->string('name'); $table->string('email')->unique(); $table->string('blood_group'); $table->string('phone_number')->unique(); $table->string('location'); $table-> ------('date_of_birth'); $table->timestamps(); 你可以看到laravel4迁移使用’string’类型而不是’varchar’.那么laravel 4中出生日期列的类型应该是什么? 解决方法
Date would be the most suitable
$table->date('date_of_birth'); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |