djc-new/database/migrations/2024_01_29_110440_create_pe...

88 lines
4.6 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('persons', function (Blueprint $table) {
$table->id();
$table->string('name')->comment('姓名');
$table->string('avatar')->nullable()->comment('头像');
$table->string('used_name')->nullable()->comment('曾用名');
$table->string('idcard', 50)->nullable()->comment('身份证号码');
$table->unsignedBigInteger('gender')->nullable()->comment('性别:0未知1男2女');
$table->date('birthday')->nullable()->comment('生日');
$table->string('origin_city_code')->nullable()->comment('户籍地区代码');
$table->unsignedBigInteger('origin_province_id')->nullable()->comment('籍贯-省');
$table->unsignedBigInteger('origin_city_id')->nullable()->comment('籍贯-市');
$table->unsignedBigInteger('origin_area_id')->nullable()->comment('籍贯-区');
$table->string('origin_complete_address')->nullable()->comment('籍贯地址');
$table->string('card_city_code')->nullable()->comment('户籍地区代码');
$table->unsignedBigInteger('card_province_id')->nullable()->comment('户籍-省');
$table->unsignedBigInteger('card_city_id')->nullable()->comment('户籍-市');
$table->unsignedBigInteger('card_area_id')->nullable()->comment('户籍-区');
$table->string('card_address')->nullable()->comment('户籍-街道详细地址');
$table->string('card_complete_address')->nullable()->comment('户籍-完整地址');
$table->unsignedBigInteger('housing_estate_id')->nullable()->comment('小区');
$table->unsignedBigInteger('building_id')->nullable()->comment('楼栋');
$table->string('house_number')->nullable()->comment('门牌号');
$table->string('house_complete_address')->nullable()->comment('小区完整地址');
$table->string('real_address')->nullable()->comment('实际居住地址');
$table->unsignedBigInteger('nation_id')->nullable()->comment('民族');
$table->unsignedBigInteger('political_face_id')->nullable()->comment('政治面貌');
$table->unsignedBigInteger('educational_level_id')->nullable()->comment('文化程度');
$table->unsignedBigInteger('marry_state_id')->nullable()->comment('婚姻状况');
$table->unsignedBigInteger('job_cate_id')->nullable()->comment('工种');
$table->string('job')->nullable()->comment('职业');
$table->string('health')->nullable()->comment('身体状况');
$table->string('phone')->nullable()->comment('联系方式');
$table->string('remark')->nullable()->comment('备注');
$table->unsignedTinyInteger('type')->nullable()->comment('类型11-出生人口,12-迁入人口11、12统称户籍人口,2-流动人口,3-留守人口,4-境外人口');
$table->unsignedTinyInteger('has_benefit')->default(0)->comment('是否享受福利');
$table->unsignedBigInteger('organized_body_id')->nullable()->comment('社别');
$table->string('t_ids')->nullable()->comment('标签');
$table->unsignedBigInteger('domicile_id')->nullable()->comment('户籍类型');
$table->string('domicile_code')->nullable()->comment('户籍编号');
$table->unsignedBigInteger('master_id')->nullable()->default(0)->comment('户主ID');
$table->unsignedTinyInteger('is_master')->default(0)->comment('是否户主');
$table->string('master_connect')->nullable()->default('')->comment('户主关系');
$table->unsignedTinyInteger('is_voter')->default(0)->comment('是否参加选民投票');
$table->string('wx_openid')->nullable()->comment('微信openId');
$table->string('baidu_face_id')->nullable()->comment('百度人脸ID');
$table->unsignedTinyInteger('state')->nullable()->comment('状态1正常2死亡3迁出');
$table->date('deathday')->nullable()->comment('死亡日期');
$table->unsignedTinyInteger('valid')->default(1)->comment('是否有效');
$table->timestamps();
$table->unique(['valid', 'idcard']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('persons');
}
};