更新遷移檔(migration)並新增自動產生的Model
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateAdminTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('Admin', function(Blueprint $table)
|
||||
{
|
||||
$table->string('ID')->primary();
|
||||
$table->string('password');
|
||||
$table->string('name');
|
||||
$table->string('nick_name');
|
||||
$table->string('email');
|
||||
$table->string('phone_number');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('Admin');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreatePasswordResetsTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('password_resets', function(Blueprint $table)
|
||||
{
|
||||
$table->string('email')->index();
|
||||
$table->string('token');
|
||||
$table->dateTime('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('password_resets');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateUsersTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users', function(Blueprint $table)
|
||||
{
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->string('password');
|
||||
$table->string('remember_token', 100)->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('users');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class AddForeignKeysToChooseTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('Choose', function(Blueprint $table)
|
||||
{
|
||||
$table->foreign('RID', 'choose_ibfk_1')->references('RID')->on('receiver')->onUpdate('RESTRICT')->onDelete('RESTRICT');
|
||||
$table->foreign('TCID', 'choose_ibfk_2')->references('TCID')->on('thecase')->onUpdate('RESTRICT')->onDelete('CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('Choose', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('choose_ibfk_1');
|
||||
$table->dropForeign('choose_ibfk_2');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ class CreateAreaTable extends Migration {
|
||||
{
|
||||
Schema::create('Area', function(Blueprint $table)
|
||||
{
|
||||
$table->integer('A_ID', true);
|
||||
$table->integer('AID', true);
|
||||
$table->string('name', 50)->comment('領域名稱');
|
||||
});
|
||||
}
|
||||
@@ -14,11 +14,11 @@ class CreateBelongTable extends Migration {
|
||||
{
|
||||
Schema::create('Belong', function(Blueprint $table)
|
||||
{
|
||||
$table->string('RID', 50);
|
||||
$table->integer('C_ID')->index('C_ID');
|
||||
$table->string('RID', 50)->comment('達人帳號');
|
||||
$table->integer('CID')->index('CID')->comment('類別編號');
|
||||
$table->date('startExclussiveDate')->nullable()->comment('排外起始時間');
|
||||
$table->date('endExclussiveDate')->nullable()->comment('排外終止時間');
|
||||
$table->primary(['RID','C_ID']);
|
||||
$table->primary(['RID','CID']);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ class CreateManageTable extends Migration {
|
||||
{
|
||||
Schema::create('Manage', function(Blueprint $table)
|
||||
{
|
||||
$table->string('RID', 50);
|
||||
$table->integer('A_ID')->index('A_ID');
|
||||
$table->string('RID', 50)->comment('達人帳號');
|
||||
$table->integer('AID')->index('AID')->comment('領域編號');
|
||||
$table->string('URL', 1024)->comment('網址');
|
||||
$table->date('createdDate')->comment('創立時間');
|
||||
$table->integer('amountOfFans')->nullable()->default(0)->comment('粉絲數');
|
||||
@@ -25,7 +25,7 @@ class CreateManageTable extends Migration {
|
||||
$table->integer('endOfCooperationFee')->comment('合作費用區間終止');
|
||||
$table->date('startOfexecutionTime')->comment('執行時間起始');
|
||||
$table->date('endOfexecutionTime')->comment('執行時間終止');
|
||||
$table->primary(['RID','A_ID']);
|
||||
$table->primary(['RID','AID']);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ class AddForeignKeysToBeClassifiedAsTable extends Migration {
|
||||
{
|
||||
Schema::table('BeClassifiedAs', function(Blueprint $table)
|
||||
{
|
||||
$table->foreign('CID', 'beclassifiedas_ibfk_1')->references('CID')->on('TheClass')->onUpdate('CASCADE')->onDelete('CASCADE');
|
||||
$table->foreign('CBID', 'beclassifiedas_ibfk_2')->references('CBID')->on('CaseBuilder')->onUpdate('RESTRICT')->onDelete('RESTRICT');
|
||||
$table->foreign('CID', 'fk_BeClassifiedAs_1')->references('CID')->on('TheClass')->onUpdate('CASCADE')->onDelete('CASCADE');
|
||||
$table->foreign('CBID', 'fk_BeClassifiedAs_2')->references('CBID')->on('CaseBuilder')->onUpdate('NO ACTION')->onDelete('NO ACTION');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ class AddForeignKeysToBeClassifiedAsTable extends Migration {
|
||||
{
|
||||
Schema::table('BeClassifiedAs', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('beclassifiedas_ibfk_1');
|
||||
$table->dropForeign('beclassifiedas_ibfk_2');
|
||||
$table->dropForeign('fk_BeClassifiedAs_1');
|
||||
$table->dropForeign('fk_BeClassifiedAs_2');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ class AddForeignKeysToBelongTable extends Migration {
|
||||
{
|
||||
Schema::table('Belong', function(Blueprint $table)
|
||||
{
|
||||
$table->foreign('C_ID', 'belong_ibfk_1')->references('C_ID')->on('theclass')->onUpdate('CASCADE')->onDelete('CASCADE');
|
||||
$table->foreign('RID', 'belong_ibfk_2')->references('RID')->on('receiver')->onUpdate('RESTRICT')->onDelete('RESTRICT');
|
||||
$table->foreign('RID', 'fk_Belong_1')->references('RID')->on('Receiver')->onUpdate('NO ACTION')->onDelete('CASCADE');
|
||||
$table->foreign('CID', 'fk_Belong_2')->references('CID')->on('TheClass')->onUpdate('NO ACTION')->onDelete('CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ class AddForeignKeysToBelongTable extends Migration {
|
||||
{
|
||||
Schema::table('Belong', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('belong_ibfk_1');
|
||||
$table->dropForeign('belong_ibfk_2');
|
||||
$table->dropForeign('fk_Belong_1');
|
||||
$table->dropForeign('fk_Belong_2');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ class AddForeignKeysToCommissionedTable extends Migration {
|
||||
{
|
||||
Schema::table('Commissioned', function(Blueprint $table)
|
||||
{
|
||||
$table->foreign('TCID', 'commissioned_ibfk_1')->references('TCID')->on('thecase')->onUpdate('RESTRICT')->onDelete('CASCADE');
|
||||
$table->foreign('RID', 'commissioned_ibfk_2')->references('RID')->on('receiver')->onUpdate('RESTRICT')->onDelete('RESTRICT');
|
||||
$table->foreign('TCID', 'fk_Commissioned_1')->references('TCID')->on('TheCase')->onUpdate('NO ACTION')->onDelete('NO ACTION');
|
||||
$table->foreign('RID', 'fk_Commissioned_2')->references('RID')->on('Receiver')->onUpdate('NO ACTION')->onDelete('CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ class AddForeignKeysToCommissionedTable extends Migration {
|
||||
{
|
||||
Schema::table('Commissioned', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('commissioned_ibfk_1');
|
||||
$table->dropForeign('commissioned_ibfk_2');
|
||||
$table->dropForeign('fk_Commissioned_1');
|
||||
$table->dropForeign('fk_Commissioned_2');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class AddForeignKeysToFlightNegotiationTable extends Migration {
|
||||
{
|
||||
Schema::table('FlightNegotiation', function(Blueprint $table)
|
||||
{
|
||||
$table->foreign('ID', 'flightnegotiation_ibfk_1')->references('ID')->on('commissioned')->onUpdate('RESTRICT')->onDelete('RESTRICT');
|
||||
$table->foreign('ID', 'fk_FlightNegotiation_1')->references('ID')->on('Commissioned')->onUpdate('NO ACTION')->onDelete('CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddForeignKeysToFlightNegotiationTable extends Migration {
|
||||
{
|
||||
Schema::table('FlightNegotiation', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('flightnegotiation_ibfk_1');
|
||||
$table->dropForeign('fk_FlightNegotiation_1');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ class AddForeignKeysToManageTable extends Migration {
|
||||
{
|
||||
Schema::table('Manage', function(Blueprint $table)
|
||||
{
|
||||
$table->foreign('A_ID', 'manage_ibfk_1')->references('A_ID')->on('area')->onUpdate('CASCADE')->onDelete('CASCADE');
|
||||
$table->foreign('RID', 'manage_ibfk_2')->references('RID')->on('receiver')->onUpdate('RESTRICT')->onDelete('RESTRICT');
|
||||
$table->foreign('RID', 'fk_Manage_1')->references('RID')->on('Receiver')->onUpdate('NO ACTION')->onDelete('NO ACTION');
|
||||
$table->foreign('AID', 'fk_Manage_2')->references('AID')->on('Area')->onUpdate('NO ACTION')->onDelete('NO ACTION');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ class AddForeignKeysToManageTable extends Migration {
|
||||
{
|
||||
Schema::table('Manage', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('manage_ibfk_1');
|
||||
$table->dropForeign('manage_ibfk_2');
|
||||
$table->dropForeign('fk_Manage_1');
|
||||
$table->dropForeign('fk_Manage_2');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ class AddForeignKeysToPreferenceTable extends Migration {
|
||||
{
|
||||
Schema::table('Preference', function(Blueprint $table)
|
||||
{
|
||||
$table->foreign('CBID', 'preference_ibfk_1')->references('CBID')->on('casebuilder')->onUpdate('RESTRICT')->onDelete('CASCADE');
|
||||
$table->foreign('RID', 'preference_ibfk_2')->references('RID')->on('receiver')->onUpdate('RESTRICT')->onDelete('CASCADE');
|
||||
$table->foreign('CBID', 'fk_Preference_1')->references('CBID')->on('CaseBuilder')->onUpdate('NO ACTION')->onDelete('NO ACTION');
|
||||
$table->foreign('RID', 'fk_Preference_2')->references('RID')->on('Receiver')->onUpdate('NO ACTION')->onDelete('NO ACTION');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ class AddForeignKeysToPreferenceTable extends Migration {
|
||||
{
|
||||
Schema::table('Preference', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('preference_ibfk_1');
|
||||
$table->dropForeign('preference_ibfk_2');
|
||||
$table->dropForeign('fk_Preference_1');
|
||||
$table->dropForeign('fk_Preference_2');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class AddForeignKeysToPriceNegotiationTable extends Migration {
|
||||
{
|
||||
Schema::table('PriceNegotiation', function(Blueprint $table)
|
||||
{
|
||||
$table->foreign('ID', 'pricenegotiation_ibfk_1')->references('ID')->on('commissioned')->onUpdate('RESTRICT')->onDelete('RESTRICT');
|
||||
$table->foreign('ID', 'fk_PriceNegotiation_1')->references('ID')->on('Commissioned')->onUpdate('NO ACTION')->onDelete('CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddForeignKeysToPriceNegotiationTable extends Migration {
|
||||
{
|
||||
Schema::table('PriceNegotiation', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('pricenegotiation_ibfk_1');
|
||||
$table->dropForeign('fk_PriceNegotiation_1');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class AddForeignKeysToProofReadingTable extends Migration {
|
||||
{
|
||||
Schema::table('ProofReading', function(Blueprint $table)
|
||||
{
|
||||
$table->foreign('ID', 'proofreading_ibfk_1')->references('ID')->on('commissioned')->onUpdate('RESTRICT')->onDelete('RESTRICT');
|
||||
$table->foreign('ID', 'fk_ProofReading_1')->references('ID')->on('Commissioned')->onUpdate('NO ACTION')->onDelete('CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddForeignKeysToProofReadingTable extends Migration {
|
||||
{
|
||||
Schema::table('ProofReading', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('proofreading_ibfk_1');
|
||||
$table->dropForeign('fk_ProofReading_1');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class AddForeignKeysToReleaseManuscriptTable extends Migration {
|
||||
{
|
||||
Schema::table('ReleaseManuscript', function(Blueprint $table)
|
||||
{
|
||||
$table->foreign('ID', 'releasemanuscript_ibfk_1')->references('ID')->on('commissioned')->onUpdate('RESTRICT')->onDelete('RESTRICT');
|
||||
$table->foreign('ID', 'fk_ReleaseManuscript_1')->references('ID')->on('Commissioned')->onUpdate('NO ACTION')->onDelete('CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddForeignKeysToReleaseManuscriptTable extends Migration {
|
||||
{
|
||||
Schema::table('ReleaseManuscript', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('releasemanuscript_ibfk_1');
|
||||
$table->dropForeign('fk_ReleaseManuscript_1');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class AddForeignKeysToTheCaseTable extends Migration {
|
||||
{
|
||||
Schema::table('TheCase', function(Blueprint $table)
|
||||
{
|
||||
$table->foreign('CBID', 'thecase_ibfk_1')->references('CBID')->on('casebuilder')->onUpdate('RESTRICT')->onDelete('CASCADE');
|
||||
$table->foreign('CBID', 'fk_TheCase_1')->references('CBID')->on('CaseBuilder')->onUpdate('NO ACTION')->onDelete('NO ACTION');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AddForeignKeysToTheCaseTable extends Migration {
|
||||
{
|
||||
Schema::table('TheCase', function(Blueprint $table)
|
||||
{
|
||||
$table->dropForeign('thecase_ibfk_1');
|
||||
$table->dropForeign('fk_TheCase_1');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user