You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							45 lines
						
					
					
						
							1.6 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							45 lines
						
					
					
						
							1.6 KiB
						
					
					
				
								<?php
							 | 
						|
								
							 | 
						|
								use Illuminate\Database\Migrations\Migration;
							 | 
						|
								use Illuminate\Database\Schema\Blueprint;
							 | 
						|
								use Illuminate\Support\Facades\Schema;
							 | 
						|
								
							 | 
						|
								class CreateDemandTable extends Migration
							 | 
						|
								{
							 | 
						|
								    /**
							 | 
						|
								     * Run the migrations.
							 | 
						|
								     *
							 | 
						|
								     * @return void
							 | 
						|
								     */
							 | 
						|
								    public function up()
							 | 
						|
								    {
							 | 
						|
								        Schema::create('demand', function (Blueprint $table) {
							 | 
						|
								            $table->id();
							 | 
						|
											$table->string('title')->comment('标题')->default('');
							 | 
						|
											$table->string('comment')->comment('内容')->default('');
							 | 
						|
											$table->dateTime('deadline')->comment('流拍时间')->nullable();
							 | 
						|
											$table->decimal('price')->comment('起拍价格')->default(0);
							 | 
						|
											$table->integer('stock')->comment('库存')->default(0);
							 | 
						|
											$table->string('publisher_type')->comment('发布人身份 类型 关联模型')->default('');
							 | 
						|
											$table->bigInteger('publisher_id')->index()->comment('发布人身份id 根据类型查不同的表')->default(1);
							 | 
						|
											$table->tinyInteger('state')->comment('状态 1 待竞标 2 已竞标 3 流拍')->default(1);
							 | 
						|
											$table->string('bidding_user_type')->comment('竞拍人 关联模型')->default(1);
							 | 
						|
											$table->bigInteger('bidding_user_id')->index()->comment('竞拍成功人用户id 关联竞标表')->default(0);
							 | 
						|
											$table->bigInteger('bidding_id')->index()->comment('竞拍成功id 关联竞标表')->default(0);
							 | 
						|
											$table->string('images')->index()->comment('图片')->default('');
							 | 
						|
											$table->dateTime('created_at')->nullable();
							 | 
						|
											$table->dateTime('updated_at')->nullable();
							 | 
						|
											$table->dateTime('deleted_at')->nullable();
							 | 
						|
								        });
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								    /**
							 | 
						|
								     * Reverse the migrations.
							 | 
						|
								     *
							 | 
						|
								     * @return void
							 | 
						|
								     */
							 | 
						|
								    public function down()
							 | 
						|
								    {
							 | 
						|
								        Schema::dropIfExists('demand');
							 | 
						|
								    }
							 | 
						|
								}
							 |