public function up()
{
// 员工信息表 staff_users
Schema::create('staff_users', function (Blueprint $table) {
$table->increments('id');
$table->char('name','10');
$table->tinyInteger('age','3');
$table->char('sex');
$table->string('address');
$table->integer('bank_card','16');
$table->string('bank_belongs');
$table->string('transfer');
$table->integer('contact');
$table->string('can','100');
$table->integer('create_at','11');
$table->integer('end_at','11');
$table->primary('id');
});
}
public function up()
{
// 员工工资结算规则表 staff_salarys
Schema::create('staff_salarys', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->char('name','20');
$table->float('salary_base');
$table->float('salary_final');
$table->tinyInteger('counts_leave');
$table->float('money_leave');
$table->tinyInteger('counts_overtime');
$table->float('money_overtime');
$table->integer('create_at','11');
$table->integer('end_at','11');
$table->primary('id');
$table->foreign('user_id')->references('id')->on('staff_users');
});
}
public function up()
{
// 加班记录表 overtime
Schema::create('overtime', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->char('name','20');
$table->integer('create_at','11');
$table->integer('end_at','11');
$table->float('money_overtime');
$table->primary('id');
$table->foreign('user_id')->references('id')->on('staff_users');
});
}
php artisan make:migration create_staff_users_table
public function up()
{
// 请假记录表 leave
Schema::create('leave', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->char('name','20');
$table->float('money_leave');
$table->integer('create_at','11');
$table->integer('end_at','11');
$table->primary('id');
$table->foreign('user_id')->references('id')->on('staff_users');
});
}
数据库迁移字段的使用
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...