更新遷移檔(migration)並新增自動產生的Model
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateTheCaseTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('TheCase', function(Blueprint $table)
|
||||
{
|
||||
$table->string('TCID', 50)->comment('案件編號');
|
||||
$table->string('CBID', 50)->index('CBID')->comment('品牌/代理商帳號');
|
||||
$table->string('name', 50)->comment('案件名稱');
|
||||
$table->string('class', 30)->comment('案件類別');
|
||||
$table->text('description', 65535)->nullable()->comment('商品描述');
|
||||
$table->integer('specialPrice')->comment('商品優惠價');
|
||||
$table->integer('price')->comment('商品市售價');
|
||||
$table->text('howToBuy', 65535)->comment('如何購買');
|
||||
$table->date('releaseDate')->comment('發佈日期');
|
||||
$table->primary(['TCID','CBID']);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('TheCase');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user