From f4158b86610b460138779545c5c0e1702e6f0fed Mon Sep 17 00:00:00 2001 From: "Tom K.H. Lin" <3011850@gmail.com> Date: Sun, 29 Jul 2018 02:23:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=81=B7=E7=A7=BB=E6=AA=94(m?= =?UTF-8?q?igration)=E4=B8=A6=E6=96=B0=E5=A2=9E=E8=87=AA=E5=8B=95=E7=94=A2?= =?UTF-8?q?=E7=94=9F=E7=9A=84Model?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Area.php | 37 ++ app/Bank.php | 32 ++ app/BeClassifiedA.php | 42 ++ app/Belong.php | 55 +++ app/CaseBuilder.php | 89 ++++ app/Choose.php | 26 ++ app/Commissioned.php | 126 ++++++ app/FlightNegotiation.php | 50 +++ app/Manage.php | 75 ++++ app/Preference.php | 44 ++ app/PriceNegotiation.php | 55 +++ app/ProofReading.php | 49 ++ app/Providers/AppServiceProvider.php | 1 + app/Receiver.php | 86 ++++ app/ReleaseManuscript.php | 49 ++ app/TheCase.php | 65 +++ app/TheClass.php | 43 ++ composer.json | 1 + composer.lock | 152 ++++--- config/app.php | 1 + config/models.php | 420 ++++++++++++++++++ .../2018_07_26_113627_create_Admin_table.php | 38 -- ...26_113627_create_password_resets_table.php | 34 -- .../2018_07_26_113627_create_users_table.php | 37 -- ...13629_add_foreign_keys_to_Choose_table.php | 37 -- ...> 2018_07_28_175045_create_Area_table.php} | 2 +- ...> 2018_07_28_175045_create_Bank_table.php} | 0 ...28_175045_create_BeClassifiedAs_table.php} | 0 ...2018_07_28_175045_create_Belong_table.php} | 6 +- ...07_28_175045_create_CaseBuilder_table.php} | 0 ...2018_07_28_175045_create_Choose_table.php} | 0 ...7_28_175045_create_Commissioned_table.php} | 0 ...175045_create_FlightNegotiation_table.php} | 0 ...2018_07_28_175045_create_Manage_table.php} | 6 +- ..._07_28_175045_create_Preference_table.php} | 0 ..._175045_create_PriceNegotiation_table.php} | 0 ...7_28_175045_create_ProofReading_table.php} | 0 ...18_07_28_175045_create_Receiver_table.php} | 0 ...175045_create_ReleaseManuscript_table.php} | 0 ...018_07_28_175045_create_TheCase_table.php} | 0 ...18_07_28_175045_create_TheClass_table.php} | 0 ..._foreign_keys_to_BeClassifiedAs_table.php} | 8 +- ...5046_add_foreign_keys_to_Belong_table.php} | 8 +- ...dd_foreign_keys_to_Commissioned_table.php} | 8 +- ...reign_keys_to_FlightNegotiation_table.php} | 4 +- ...5046_add_foreign_keys_to_Manage_table.php} | 8 +- ..._add_foreign_keys_to_Preference_table.php} | 8 +- ...oreign_keys_to_PriceNegotiation_table.php} | 4 +- ...dd_foreign_keys_to_ProofReading_table.php} | 4 +- ...reign_keys_to_ReleaseManuscript_table.php} | 4 +- ...046_add_foreign_keys_to_TheCase_table.php} | 4 +- 51 files changed, 1485 insertions(+), 233 deletions(-) create mode 100644 app/Area.php create mode 100644 app/Bank.php create mode 100644 app/BeClassifiedA.php create mode 100644 app/Belong.php create mode 100644 app/CaseBuilder.php create mode 100644 app/Choose.php create mode 100644 app/Commissioned.php create mode 100644 app/FlightNegotiation.php create mode 100644 app/Manage.php create mode 100644 app/Preference.php create mode 100644 app/PriceNegotiation.php create mode 100644 app/ProofReading.php create mode 100644 app/Receiver.php create mode 100644 app/ReleaseManuscript.php create mode 100644 app/TheCase.php create mode 100644 app/TheClass.php create mode 100644 config/models.php delete mode 100644 database/migrations/2018_07_26_113627_create_Admin_table.php delete mode 100644 database/migrations/2018_07_26_113627_create_password_resets_table.php delete mode 100644 database/migrations/2018_07_26_113627_create_users_table.php delete mode 100644 database/migrations/2018_07_26_113629_add_foreign_keys_to_Choose_table.php rename database/migrations/{2018_07_26_113627_create_Area_table.php => 2018_07_28_175045_create_Area_table.php} (93%) rename database/migrations/{2018_07_26_113627_create_Bank_table.php => 2018_07_28_175045_create_Bank_table.php} (100%) rename database/migrations/{2018_07_26_113627_create_BeClassifiedAs_table.php => 2018_07_28_175045_create_BeClassifiedAs_table.php} (100%) rename database/migrations/{2018_07_26_113627_create_Belong_table.php => 2018_07_28_175045_create_Belong_table.php} (78%) rename database/migrations/{2018_07_26_113627_create_CaseBuilder_table.php => 2018_07_28_175045_create_CaseBuilder_table.php} (100%) rename database/migrations/{2018_07_26_113627_create_Choose_table.php => 2018_07_28_175045_create_Choose_table.php} (100%) rename database/migrations/{2018_07_26_113627_create_Commissioned_table.php => 2018_07_28_175045_create_Commissioned_table.php} (100%) rename database/migrations/{2018_07_26_113627_create_FlightNegotiation_table.php => 2018_07_28_175045_create_FlightNegotiation_table.php} (100%) rename database/migrations/{2018_07_26_113627_create_Manage_table.php => 2018_07_28_175045_create_Manage_table.php} (87%) rename database/migrations/{2018_07_26_113627_create_Preference_table.php => 2018_07_28_175045_create_Preference_table.php} (100%) rename database/migrations/{2018_07_26_113627_create_PriceNegotiation_table.php => 2018_07_28_175045_create_PriceNegotiation_table.php} (100%) rename database/migrations/{2018_07_26_113627_create_ProofReading_table.php => 2018_07_28_175045_create_ProofReading_table.php} (100%) rename database/migrations/{2018_07_26_113627_create_Receiver_table.php => 2018_07_28_175045_create_Receiver_table.php} (100%) rename database/migrations/{2018_07_26_113627_create_ReleaseManuscript_table.php => 2018_07_28_175045_create_ReleaseManuscript_table.php} (100%) rename database/migrations/{2018_07_26_113627_create_TheCase_table.php => 2018_07_28_175045_create_TheCase_table.php} (100%) rename database/migrations/{2018_07_26_113627_create_TheClass_table.php => 2018_07_28_175045_create_TheClass_table.php} (100%) rename database/migrations/{2018_07_26_113629_add_foreign_keys_to_BeClassifiedAs_table.php => 2018_07_28_175046_add_foreign_keys_to_BeClassifiedAs_table.php} (56%) rename database/migrations/{2018_07_26_113629_add_foreign_keys_to_Belong_table.php => 2018_07_28_175046_add_foreign_keys_to_Belong_table.php} (58%) rename database/migrations/{2018_07_26_113629_add_foreign_keys_to_Commissioned_table.php => 2018_07_28_175046_add_foreign_keys_to_Commissioned_table.php} (57%) rename database/migrations/{2018_07_26_113629_add_foreign_keys_to_FlightNegotiation_table.php => 2018_07_28_175046_add_foreign_keys_to_FlightNegotiation_table.php} (72%) rename database/migrations/{2018_07_26_113629_add_foreign_keys_to_Manage_table.php => 2018_07_28_175046_add_foreign_keys_to_Manage_table.php} (58%) rename database/migrations/{2018_07_26_113629_add_foreign_keys_to_Preference_table.php => 2018_07_28_175046_add_foreign_keys_to_Preference_table.php} (57%) rename database/migrations/{2018_07_26_113629_add_foreign_keys_to_PriceNegotiation_table.php => 2018_07_28_175046_add_foreign_keys_to_PriceNegotiation_table.php} (72%) rename database/migrations/{2018_07_26_113629_add_foreign_keys_to_ProofReading_table.php => 2018_07_28_175046_add_foreign_keys_to_ProofReading_table.php} (72%) rename database/migrations/{2018_07_26_113629_add_foreign_keys_to_ReleaseManuscript_table.php => 2018_07_28_175046_add_foreign_keys_to_ReleaseManuscript_table.php} (72%) rename database/migrations/{2018_07_26_113629_add_foreign_keys_to_TheCase_table.php => 2018_07_28_175046_add_foreign_keys_to_TheCase_table.php} (72%) diff --git a/app/Area.php b/app/Area.php new file mode 100644 index 0000000..a35a584 --- /dev/null +++ b/app/Area.php @@ -0,0 +1,37 @@ +hasMany(\App\Manage::class, 'AID'); + } +} diff --git a/app/Bank.php b/app/Bank.php new file mode 100644 index 0000000..b8e90a7 --- /dev/null +++ b/app/Bank.php @@ -0,0 +1,32 @@ + 'int' + ]; + + public function the_class() + { + return $this->belongsTo(\App\TheClass::class, 'CID'); + } + + public function case_builder() + { + return $this->belongsTo(\App\CaseBuilder::class, 'CBID'); + } +} diff --git a/app/Belong.php b/app/Belong.php new file mode 100644 index 0000000..2cba583 --- /dev/null +++ b/app/Belong.php @@ -0,0 +1,55 @@ + 'int' + ]; + + protected $dates = [ + 'startExclussiveDate', + 'endExclussiveDate' + ]; + + protected $fillable = [ + 'startExclussiveDate', + 'endExclussiveDate' + ]; + + public function receiver() + { + return $this->belongsTo(\App\Receiver::class, 'RID'); + } + + public function the_class() + { + return $this->belongsTo(\App\TheClass::class, 'CID'); + } +} diff --git a/app/CaseBuilder.php b/app/CaseBuilder.php new file mode 100644 index 0000000..d138eb5 --- /dev/null +++ b/app/CaseBuilder.php @@ -0,0 +1,89 @@ + 'int' + ]; + + protected $dates = [ + 'startServiceDate', + 'endServiceDate' + ]; + + protected $hidden = [ + 'password' + ]; + + protected $fillable = [ + 'password', + 'companyName', + 'companyPhone', + 'companyAddress', + 'uniformNumber', + 'contact', + 'contactNumber', + 'contactEmail', + 'isProxy', + 'frequency', + 'payment', + 'startServiceDate', + 'endServiceDate', + 'verifyStatus' + ]; + + public function be_classified_as() + { + return $this->hasMany(\App\BeClassifiedA::class, 'CBID'); + } + + public function preferences() + { + return $this->hasMany(\App\Preference::class, 'CBID'); + } + + public function the_cases() + { + return $this->hasMany(\App\TheCase::class, 'CBID'); + } +} diff --git a/app/Choose.php b/app/Choose.php new file mode 100644 index 0000000..87599bd --- /dev/null +++ b/app/Choose.php @@ -0,0 +1,26 @@ + 'int', + 'PriceNegotiationStatus' => 'int', + 'caseExecutionStatus' => 'int', + 'amountOfPay' => 'int', + 'caseDifficulty' => 'int', + 'receiverRating' => 'int', + 'casebuilderRating' => 'int' + ]; + + protected $dates = [ + 'commissionedDate', + 'terminationDate', + 'PaymentTime' + ]; + + protected $fillable = [ + 'TCID', + 'RID', + 'commissionedDate', + 'pointOfArtical', + 'amountOfwords', + 'numOfImgesRequired', + 'FlightNegotiationStatus', + 'PriceNegotiationStatus', + 'caseExecutionStatus', + 'commentOfReceiver', + 'commentOfCaseBuilder', + 'reasonOfTerminate', + 'terminationDate', + 'PaymentTime', + 'paymentMethod', + 'bankName', + 'amountOfPay', + 'AccuountNumber', + 'MailID', + 'caseDifficulty', + 'receiverRating', + 'casebuilderRating' + ]; + + public function the_case() + { + return $this->belongsTo(\App\TheCase::class, 'TCID'); + } + + public function receiver() + { + return $this->belongsTo(\App\Receiver::class, 'RID'); + } + + public function flight_negotiations() + { + return $this->hasMany(\App\FlightNegotiation::class, 'ID'); + } + + public function price_negotiations() + { + return $this->hasMany(\App\PriceNegotiation::class, 'ID'); + } + + public function proof_readings() + { + return $this->hasMany(\App\ProofReading::class, 'ID'); + } + + public function release_manuscripts() + { + return $this->hasMany(\App\ReleaseManuscript::class, 'ID'); + } +} diff --git a/app/FlightNegotiation.php b/app/FlightNegotiation.php new file mode 100644 index 0000000..7d9852e --- /dev/null +++ b/app/FlightNegotiation.php @@ -0,0 +1,50 @@ +belongsTo(\App\Commissioned::class, 'ID'); + } +} diff --git a/app/Manage.php b/app/Manage.php new file mode 100644 index 0000000..37c28e5 --- /dev/null +++ b/app/Manage.php @@ -0,0 +1,75 @@ + 'int', + 'amountOfFans' => 'int', + 'avgNumOfVisitorsPerDay' => 'int', + 'numOfEntriesPerPage' => 'int', + 'startOfCooperationFee' => 'int', + 'endOfCooperationFee' => 'int' + ]; + + protected $dates = [ + 'createdDate', + 'startOfexecutionTime', + 'endOfexecutionTime' + ]; + + protected $fillable = [ + 'URL', + 'createdDate', + 'amountOfFans', + 'avgNumOfVisitorsPerDay', + 'numOfEntriesPerPage', + 'startOfCooperationFee', + 'endOfCooperationFee', + 'startOfexecutionTime', + 'endOfexecutionTime' + ]; + + public function receiver() + { + return $this->belongsTo(\App\Receiver::class, 'RID'); + } + + public function area() + { + return $this->belongsTo(\App\Area::class, 'AID'); + } +} diff --git a/app/Preference.php b/app/Preference.php new file mode 100644 index 0000000..4f476db --- /dev/null +++ b/app/Preference.php @@ -0,0 +1,44 @@ +belongsTo(\App\CaseBuilder::class, 'CBID'); + } + + public function receiver() + { + return $this->belongsTo(\App\Receiver::class, 'RID'); + } +} diff --git a/app/PriceNegotiation.php b/app/PriceNegotiation.php new file mode 100644 index 0000000..d3130df --- /dev/null +++ b/app/PriceNegotiation.php @@ -0,0 +1,55 @@ + 'int', + 'price' => 'int' + ]; + + protected $dates = [ + 'negotiationDate' + ]; + + protected $fillable = [ + 'negotiator', + 'itemName', + 'itemValue', + 'price', + 'description' + ]; + + public function commissioned() + { + return $this->belongsTo(\App\Commissioned::class, 'ID'); + } +} diff --git a/app/ProofReading.php b/app/ProofReading.php new file mode 100644 index 0000000..afaa316 --- /dev/null +++ b/app/ProofReading.php @@ -0,0 +1,49 @@ +belongsTo(\App\Commissioned::class, 'ID'); + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 8bb91f0..f734a2e 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -26,6 +26,7 @@ class AppServiceProvider extends ServiceProvider if ($this->app->environment() !== 'production') { $this->app->register(\Way\Generators\GeneratorsServiceProvider::class); $this->app->register(\Xethron\MigrationsGenerator\MigrationsGeneratorServiceProvider::class); + $this->app->register(\Reliese\Coders\CodersServiceProvider::class); } } } diff --git a/app/Receiver.php b/app/Receiver.php new file mode 100644 index 0000000..540c507 --- /dev/null +++ b/app/Receiver.php @@ -0,0 +1,86 @@ + 'int' + ]; + + protected $hidden = [ + 'password' + ]; + + protected $fillable = [ + 'password', + 'name', + 'nickName', + 'phone', + 'email', + 'address', + 'indroduction', + 'photoPath', + 'bankName', + 'bankID', + 'verifyStatus', + 'bankLocation' + ]; + + public function belongs() + { + return $this->hasMany(\App\Belong::class, 'RID'); + } + + public function commissioneds() + { + return $this->hasMany(\App\Commissioned::class, 'RID'); + } + + public function manages() + { + return $this->hasMany(\App\Manage::class, 'RID'); + } + + public function preferences() + { + return $this->hasMany(\App\Preference::class, 'RID'); + } +} diff --git a/app/ReleaseManuscript.php b/app/ReleaseManuscript.php new file mode 100644 index 0000000..c7cc6a8 --- /dev/null +++ b/app/ReleaseManuscript.php @@ -0,0 +1,49 @@ +belongsTo(\App\Commissioned::class, 'ID'); + } +} diff --git a/app/TheCase.php b/app/TheCase.php new file mode 100644 index 0000000..05dbd95 --- /dev/null +++ b/app/TheCase.php @@ -0,0 +1,65 @@ + 'int', + 'price' => 'int' + ]; + + protected $dates = [ + 'releaseDate' + ]; + + protected $fillable = [ + 'name', + 'class', + 'description', + 'specialPrice', + 'price', + 'howToBuy', + 'releaseDate' + ]; + + public function case_builder() + { + return $this->belongsTo(\App\CaseBuilder::class, 'CBID'); + } + + public function commissioneds() + { + return $this->hasMany(\App\Commissioned::class, 'TCID'); + } +} diff --git a/app/TheClass.php b/app/TheClass.php new file mode 100644 index 0000000..8c2401c --- /dev/null +++ b/app/TheClass.php @@ -0,0 +1,43 @@ +hasMany(\App\BeClassifiedA::class, 'CID'); + } + + public function belongs() + { + return $this->hasMany(\App\Belong::class, 'CID'); + } +} diff --git a/composer.json b/composer.json index 77f7351..f7926b7 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ "mockery/mockery": "^1.0", "nunomaduro/collision": "^2.0", "phpunit/phpunit": "^7.0", + "reliese/laravel": "^0.0.13", "xethron/migrations-generator": "^2.0" }, "autoload": { diff --git a/composer.lock b/composer.lock index 480a5d0..7dde8d0 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "74b545bf3ad701ef07e1d8533bc2936d", + "content-hash": "4fb6b4f06a8ba5b5e8f85ee0df5a4c3e", "packages": [ { "name": "dnoegel/php-xdg-base-dir", @@ -455,16 +455,16 @@ }, { "name": "laravel/framework", - "version": "v5.6.28", + "version": "v5.6.29", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "40ba2ee0e61cb4bc3c9f1dab04908e6acf06b86f" + "reference": "acc6b5c54ab196d3358f60acc5f55d9ebaaccc02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/40ba2ee0e61cb4bc3c9f1dab04908e6acf06b86f", - "reference": "40ba2ee0e61cb4bc3c9f1dab04908e6acf06b86f", + "url": "https://api.github.com/repos/laravel/framework/zipball/acc6b5c54ab196d3358f60acc5f55d9ebaaccc02", + "reference": "acc6b5c54ab196d3358f60acc5f55d9ebaaccc02", "shasum": "" }, "require": { @@ -590,7 +590,7 @@ "framework", "laravel" ], - "time": "2018-07-17T14:15:36+00:00" + "time": "2018-07-26T16:01:26+00:00" }, { "name": "laravel/tinker", @@ -1325,16 +1325,16 @@ }, { "name": "symfony/console", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f" + "reference": "5c31f6a97c1c240707f6d786e7e59bfacdbc0219" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/70591cda56b4b47c55776ac78e157c4bb6c8b43f", - "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f", + "url": "https://api.github.com/repos/symfony/console/zipball/5c31f6a97c1c240707f6d786e7e59bfacdbc0219", + "reference": "5c31f6a97c1c240707f6d786e7e59bfacdbc0219", "shasum": "" }, "require": { @@ -1389,11 +1389,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-05-31T10:17:53+00:00" + "time": "2018-07-16T14:05:40+00:00" }, { "name": "symfony/css-selector", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -1446,16 +1446,16 @@ }, { "name": "symfony/debug", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "dbe0fad88046a755dcf9379f2964c61a02f5ae3d" + "reference": "a1f2118cedb8731c45e945cdd2b808ca82abc4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/dbe0fad88046a755dcf9379f2964c61a02f5ae3d", - "reference": "dbe0fad88046a755dcf9379f2964c61a02f5ae3d", + "url": "https://api.github.com/repos/symfony/debug/zipball/a1f2118cedb8731c45e945cdd2b808ca82abc4b5", + "reference": "a1f2118cedb8731c45e945cdd2b808ca82abc4b5", "shasum": "" }, "require": { @@ -1498,20 +1498,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-06-08T09:39:36+00:00" + "time": "2018-07-06T14:52:28+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5" + "reference": "00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2391ed210a239868e7256eb6921b1bd83f3087b5", - "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f", + "reference": "00d64638e4f0703a00ab7fc2c8ae5f75f3b4020f", "shasum": "" }, "require": { @@ -1561,11 +1561,11 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-04-06T07:35:57+00:00" + "time": "2018-07-10T11:02:47+00:00" }, { "name": "symfony/finder", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -1614,16 +1614,16 @@ }, { "name": "symfony/http-foundation", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "4f9c7cf962e635b0b26b14500ac046e07dbef7f3" + "reference": "8da9ea68ab2d80dfabd41e0d14b9606bb47a10c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/4f9c7cf962e635b0b26b14500ac046e07dbef7f3", - "reference": "4f9c7cf962e635b0b26b14500ac046e07dbef7f3", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/8da9ea68ab2d80dfabd41e0d14b9606bb47a10c0", + "reference": "8da9ea68ab2d80dfabd41e0d14b9606bb47a10c0", "shasum": "" }, "require": { @@ -1664,20 +1664,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-06-19T21:38:16+00:00" + "time": "2018-07-16T14:05:40+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "29c094a1c4f8209b7e033f612cbbd69029e38955" + "reference": "ebd28f4f88a2ca0a0488882ad73c4004f3afdbe3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/29c094a1c4f8209b7e033f612cbbd69029e38955", - "reference": "29c094a1c4f8209b7e033f612cbbd69029e38955", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/ebd28f4f88a2ca0a0488882ad73c4004f3afdbe3", + "reference": "ebd28f4f88a2ca0a0488882ad73c4004f3afdbe3", "shasum": "" }, "require": { @@ -1751,7 +1751,7 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2018-06-25T13:06:45+00:00" + "time": "2018-07-23T17:16:22+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1924,7 +1924,7 @@ }, { "name": "symfony/process", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -1973,16 +1973,16 @@ }, { "name": "symfony/routing", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "b38b9797327b26ea2e4146a40e6e2dc9820a6932" + "reference": "73770bf3682b4407b017c2bdcb2b11cdcbce5322" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/b38b9797327b26ea2e4146a40e6e2dc9820a6932", - "reference": "b38b9797327b26ea2e4146a40e6e2dc9820a6932", + "url": "https://api.github.com/repos/symfony/routing/zipball/73770bf3682b4407b017c2bdcb2b11cdcbce5322", + "reference": "73770bf3682b4407b017c2bdcb2b11cdcbce5322", "shasum": "" }, "require": { @@ -2046,20 +2046,20 @@ "uri", "url" ], - "time": "2018-06-19T21:38:16+00:00" + "time": "2018-06-28T06:30:33+00:00" }, { "name": "symfony/translation", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "b6d8164085ee0b6debcd1b7a131fd6f63bb04854" + "reference": "2dd74d6b2dcbd46a93971e6ce7d245cf3123e957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/b6d8164085ee0b6debcd1b7a131fd6f63bb04854", - "reference": "b6d8164085ee0b6debcd1b7a131fd6f63bb04854", + "url": "https://api.github.com/repos/symfony/translation/zipball/2dd74d6b2dcbd46a93971e6ce7d245cf3123e957", + "reference": "2dd74d6b2dcbd46a93971e6ce7d245cf3123e957", "shasum": "" }, "require": { @@ -2115,20 +2115,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-06-22T08:59:39+00:00" + "time": "2018-07-23T08:20:20+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.1.1", + "version": "v4.1.2", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "b2eebaec085d1f2cafbad7644733d494a3bbbc9b" + "reference": "9f882aed43f364de1d43038e8fb39703c577afc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/b2eebaec085d1f2cafbad7644733d494a3bbbc9b", - "reference": "b2eebaec085d1f2cafbad7644733d494a3bbbc9b", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9f882aed43f364de1d43038e8fb39703c577afc1", + "reference": "9f882aed43f364de1d43038e8fb39703c577afc1", "shasum": "" }, "require": { @@ -2190,7 +2190,7 @@ "debug", "dump" ], - "time": "2018-06-23T12:23:56+00:00" + "time": "2018-07-05T11:54:23+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -3558,6 +3558,58 @@ ], "time": "2018-07-15T05:20:50+00:00" }, + { + "name": "reliese/laravel", + "version": "v0.0.13", + "source": { + "type": "git", + "url": "https://github.com/reliese/laravel.git", + "reference": "10075c5f5e67efba18d781216ff5a0ffa3fc2d7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reliese/laravel/zipball/10075c5f5e67efba18d781216ff5a0ffa3fc2d7f", + "reference": "10075c5f5e67efba18d781216ff5a0ffa3fc2d7f", + "shasum": "" + }, + "require": { + "doctrine/dbal": "~2.5", + "illuminate/console": "~5.1", + "illuminate/contracts": "~5.1", + "illuminate/database": "~5.1", + "illuminate/filesystem": "~5.1", + "illuminate/support": "~5.1", + "php": ">=5.6.4" + }, + "require-dev": { + "fzaninotto/faker": "~1.4", + "mockery/mockery": "0.9.*", + "phpunit/phpunit": "~5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Reliese\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Cristian Llanos", + "email": "cristianllanos@outlook.com" + } + ], + "description": "Reliese Components for Laravel Framework code generation.", + "homepage": "http://cristianllanos.com", + "keywords": [ + "laravel", + "reliese" + ], + "time": "2017-02-04T15:50:39+00:00" + }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", diff --git a/config/app.php b/config/app.php index fb18899..8e57c1b 100644 --- a/config/app.php +++ b/config/app.php @@ -153,6 +153,7 @@ return [ Way\Generators\GeneratorsServiceProvider::class, Xethron\MigrationsGenerator\MigrationsGeneratorServiceProvider::class, + Reliese\Coders\CodersServiceProvider::class, /* * Application Service Providers... diff --git a/config/models.php b/config/models.php new file mode 100644 index 0000000..32dcf20 --- /dev/null +++ b/config/models.php @@ -0,0 +1,420 @@ + [ + + /* + |-------------------------------------------------------------------------- + | Model Files Location + |-------------------------------------------------------------------------- + | + | We need a location to store your new generated files. All files will be + | placed within this directory. When you turn on base files, they will + | be placed within a Base directory inside this location. + | + */ + + 'path' => app_path('app'), + + /* + |-------------------------------------------------------------------------- + | Model Namespace + |-------------------------------------------------------------------------- + | + | Every generated model will belong to this namespace. It is suggested + | that this namespace should follow PSR-4 convention and be very + | similar to the path of your models defined above. + | + */ + + 'namespace' => 'App', + + /* + |-------------------------------------------------------------------------- + | Parent Class + |-------------------------------------------------------------------------- + | + | All Eloquent models should inherit from Eloquent Model class. However, + | you can define a custom Eloquent model that suits your needs. + | As an example one custom model has been added for you which + | will allow you to create custom database castings. + | + */ + + 'parent' => Illuminate\Database\Eloquent\Model::class, + + /* + |-------------------------------------------------------------------------- + | Traits + |-------------------------------------------------------------------------- + | + | Sometimes you may want to append certain traits to all your models. + | If that is what you need, you may list them bellow. + | As an example we have a BitBooleans trait which will treat MySQL bit + | data type as booleans. You might probably not need it, but it is + | an example of how you can customize your models. + | + */ + + 'use' => [ + // Reliese\Database\Eloquent\BitBooleans::class, + // Reliese\Database\Eloquent\BlamableBehavior::class, + ], + + /* + |-------------------------------------------------------------------------- + | Model Connection + |-------------------------------------------------------------------------- + | + | If you wish your models had appended the connection from which they + | were generated, you should set this value to true and your + | models will have the connection property filled. + | + */ + + 'connection' => true, + + /* + |-------------------------------------------------------------------------- + | Timestamps + |-------------------------------------------------------------------------- + | + | If your tables have CREATED_AT and UPDATED_AT timestamps you may + | enable them and your models will fill their values as needed. + | You can also specify which fields should be treated as timestamps + | in case you don't follow the naming convention Eloquent uses. + | If your table doesn't have these fields, timestamps will be + | disabled for your model. + | + */ + + 'timestamps' => true, + + 'timestamps' => [ + 'enabled' => true, + 'fields' => [ + 'CREATED_AT' => 'created_at', + 'UPDATED_AT' => 'updated_at', + ] + ], + + /* + |-------------------------------------------------------------------------- + | Soft Deletes + |-------------------------------------------------------------------------- + | + | If your tables support soft deletes with a DELETED_AT attribute, + | you can enable them here. You can also specify which field + | should be treated as a soft delete attribute in case you + | don't follow the naming convention Eloquent uses. + | If your table doesn't have this field, soft deletes will be + | disabled for your model. + | + */ + + 'soft_deletes' => false, + + // 'soft_deletes' => [ + // 'enabled' => true, + // 'field' => 'deleted_at', + // ], + + /* + |-------------------------------------------------------------------------- + | Date Format + |-------------------------------------------------------------------------- + | + | Here you may define your models' date format. The following format + | is the default format Eloquent uses. You won't see it in your + | models unless you change it to a more convenient value. + | + */ + + 'date_format' => 'Y-m-d H:i:s', + + /* + |-------------------------------------------------------------------------- + | Pagination + |-------------------------------------------------------------------------- + | + | Here you may define how many models Eloquent should display when + | paginating them. The default number is 15, so you might not + | see this number in your models unless you change it. + | + */ + + 'per_page' => 15, + + /* + |-------------------------------------------------------------------------- + | Base Files + |-------------------------------------------------------------------------- + | + | By default, your models will be generated in your models path, but + | when you generate them again they will be replaced by new ones. + | You may want to customize your models and, at the same time, be + | able to generate them as your tables change. For that, you + | can enable base files. These files will be replaced whenever + | you generate them, but your customized files will not be touched. + | + */ + + 'base_files' => false, + + /* + |-------------------------------------------------------------------------- + | Snake Attributes + |-------------------------------------------------------------------------- + | + | Eloquent treats your model attributes as snake cased attributes, but + | if you have camel-cased fields in your database you can disable + | that behaviour and use camel case attributes in your models. + | + */ + + 'snake_attributes' => true, + + /* + |-------------------------------------------------------------------------- + | Indent options + |-------------------------------------------------------------------------- + | + | As default indention is done with tabs, but you can change it by setting + | this to the amount of spaces you that you want to use for indentation. + | Usually you will use 4 spaces instead of tabs. + | + */ + + 'indent_with_space' => 0, + + /* + |-------------------------------------------------------------------------- + | Qualified Table Names + |-------------------------------------------------------------------------- + | + | If some of your tables have cross-database relationships (probably in + | MySQL), you can make sure your models take into account their + | respective database schema. + | + | Can Either be NULL, FALSE or TRUE + | TRUE: Schema name will be prepended on the table + | FALSE:Table name will be set without schema name. + | NULL: Table name will follow laravel pattern, + | i.e if class name(plural) matches table name, then table name will not be added + */ + + 'qualified_tables' => false, + + /* + |-------------------------------------------------------------------------- + | Hidden Attributes + |-------------------------------------------------------------------------- + | + | When casting your models into arrays or json, the need to hide some + | attributes sometimes arise. If your tables have some fields you + | want to hide, you can define them bellow. + | Some fields were defined for you. + | + */ + + 'hidden' => [ + '*secret*', '*password', '*token', + ], + + /* + |-------------------------------------------------------------------------- + | Mass Assignment Guarded Attributes + |-------------------------------------------------------------------------- + | + | You may want to protect some fields from mass assignment. You can + | define them bellow. Some fields were defined for you. + | Your fillable attributes will be those which are not in the list + | excluding your models' primary keys. + | + */ + + 'guarded' => [ + // 'created_by', 'updated_by' + ], + + /* + |-------------------------------------------------------------------------- + | Casts + |-------------------------------------------------------------------------- + | + | You may want to specify which of your table fields should be casted as + | something different than a string. For instance, you may want a + | text field be casted as an array or and object. + | + | You may define column patterns which will be casted using the value + | assigned. We have defined some fields for you. Feel free to + | modify them to fit your needs. + | + */ + + 'casts' => [ + '*_json' => 'json', + ], + + /* + |-------------------------------------------------------------------------- + | Excluded Tables + |-------------------------------------------------------------------------- + | + | When performing the generation of models you may want to skip some of + | them, because you don't want a model for them or any other reason. + | You can define those tables bellow. The migrations table was + | filled for you, since you may not want a model for it. + | + */ + + 'except' => [ + 'migrations', + ], + + /* + |-------------------------------------------------------------------------- + | Specified Tables + |-------------------------------------------------------------------------- + | + | You can specify specific tables. This will generate the models only + | for selected tables, ignoring the rest. + | + */ + + 'only' => [ + // 'users', + ], + + /* + |-------------------------------------------------------------------------- + | Table Prefix + |-------------------------------------------------------------------------- + | + | If you have a prefix on your table names but don't want it in the model + | and relation names, specify it here. + | + */ + + 'table_prefix' => '', + + /* + |-------------------------------------------------------------------------- + | Lower table name before doing studly + |-------------------------------------------------------------------------- + | + | If tables names are capitalised using studly produces incorrect name + | this can help fix it ie TABLE_NAME now becomes TableName + | + */ + + 'lower_table_name_first' => false, + + /* + |-------------------------------------------------------------------------- + | Relation Name Strategy + |-------------------------------------------------------------------------- + | + | How the relations should be named in your models. + | + | 'related' Use the related table as the relation name. + | (post.author --> user.id) + generates Post::user() and User::posts() + | + | 'foreign_key' Use the foreign key as the relation name. + | (post.author --> user.id) + | generates Post::author() and User::posts_author() + | Column id's are ignored. + | (post.author_id --> user.id) + | generates the same as above. + | When the foreign key is redundant, it is omited. + | (post.user_id --> user.id) + | generates User::posts() and not User::posts_user() + */ + + 'relation_name_strategy' => 'related', + // 'relation_name_strategy' => 'foreign_key', + + /* + |-------------------------------------------------------------------------- + | Determines need or not to generate constants with properties names like + | + | ... + | const AGE = 'age'; + | const USER_NAME = 'user_name'; + | ... + | + | that later can be used in QueryBuilder like + | + | ... + | $builder->select([User::USER_NAME])->where(User::AGE, '<=', 18); + | ... + | + | that helps to avoid typos in strings when typing field names and allows to use + | code competition with available model's field names. + */ + 'with_property_constants' => false, + + /* + |-------------------------------------------------------------------------- + | Disable Pluralization Name + |-------------------------------------------------------------------------- + | + | You can disable pluralization tables and relations + | + */ + 'pluralize' => true, + + /* + |-------------------------------------------------------------------------- + | Disable Pluralization Except For Certain Tables + |-------------------------------------------------------------------------- + | + | You can enable pluralization for certain tables + | + */ + 'override_pluralize_for' => [ + + ], + ], + + /* + |-------------------------------------------------------------------------- + | Database Specifics + |-------------------------------------------------------------------------- + | + | In this section you may define the default configuration for each model + | that will be generated from a specific database. You can also nest + | table specific configurations. + | These values will override those defined in the section above. + | + */ + + // 'shop' => [ + // 'path' => app_path(), + // 'namespace' => 'App', + // 'snake_attributes' => false, + // 'qualified_tables' => true, + // 'use' => [ + // Reliese\Database\Eloquent\BitBooleans::class, + // ], + // 'except' => ['migrations'], + // 'only' => ['users'], + // // Table Specifics Bellow: + // 'user' => [ + // // Don't use any default trait + // 'use' => [], + // ] + // ], +]; diff --git a/database/migrations/2018_07_26_113627_create_Admin_table.php b/database/migrations/2018_07_26_113627_create_Admin_table.php deleted file mode 100644 index 7533c6f..0000000 --- a/database/migrations/2018_07_26_113627_create_Admin_table.php +++ /dev/null @@ -1,38 +0,0 @@ -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'); - } - -} diff --git a/database/migrations/2018_07_26_113627_create_password_resets_table.php b/database/migrations/2018_07_26_113627_create_password_resets_table.php deleted file mode 100644 index 2fcab1a..0000000 --- a/database/migrations/2018_07_26_113627_create_password_resets_table.php +++ /dev/null @@ -1,34 +0,0 @@ -string('email')->index(); - $table->string('token'); - $table->dateTime('created_at')->nullable(); - }); - } - - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('password_resets'); - } - -} diff --git a/database/migrations/2018_07_26_113627_create_users_table.php b/database/migrations/2018_07_26_113627_create_users_table.php deleted file mode 100644 index a19ec65..0000000 --- a/database/migrations/2018_07_26_113627_create_users_table.php +++ /dev/null @@ -1,37 +0,0 @@ -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'); - } - -} diff --git a/database/migrations/2018_07_26_113629_add_foreign_keys_to_Choose_table.php b/database/migrations/2018_07_26_113629_add_foreign_keys_to_Choose_table.php deleted file mode 100644 index daff1f8..0000000 --- a/database/migrations/2018_07_26_113629_add_foreign_keys_to_Choose_table.php +++ /dev/null @@ -1,37 +0,0 @@ -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'); - }); - } - -} diff --git a/database/migrations/2018_07_26_113627_create_Area_table.php b/database/migrations/2018_07_28_175045_create_Area_table.php similarity index 93% rename from database/migrations/2018_07_26_113627_create_Area_table.php rename to database/migrations/2018_07_28_175045_create_Area_table.php index 688d8ed..b7ecad6 100644 --- a/database/migrations/2018_07_26_113627_create_Area_table.php +++ b/database/migrations/2018_07_28_175045_create_Area_table.php @@ -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('領域名稱'); }); } diff --git a/database/migrations/2018_07_26_113627_create_Bank_table.php b/database/migrations/2018_07_28_175045_create_Bank_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_Bank_table.php rename to database/migrations/2018_07_28_175045_create_Bank_table.php diff --git a/database/migrations/2018_07_26_113627_create_BeClassifiedAs_table.php b/database/migrations/2018_07_28_175045_create_BeClassifiedAs_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_BeClassifiedAs_table.php rename to database/migrations/2018_07_28_175045_create_BeClassifiedAs_table.php diff --git a/database/migrations/2018_07_26_113627_create_Belong_table.php b/database/migrations/2018_07_28_175045_create_Belong_table.php similarity index 78% rename from database/migrations/2018_07_26_113627_create_Belong_table.php rename to database/migrations/2018_07_28_175045_create_Belong_table.php index bb77855..9a488af 100644 --- a/database/migrations/2018_07_26_113627_create_Belong_table.php +++ b/database/migrations/2018_07_28_175045_create_Belong_table.php @@ -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']); }); } diff --git a/database/migrations/2018_07_26_113627_create_CaseBuilder_table.php b/database/migrations/2018_07_28_175045_create_CaseBuilder_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_CaseBuilder_table.php rename to database/migrations/2018_07_28_175045_create_CaseBuilder_table.php diff --git a/database/migrations/2018_07_26_113627_create_Choose_table.php b/database/migrations/2018_07_28_175045_create_Choose_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_Choose_table.php rename to database/migrations/2018_07_28_175045_create_Choose_table.php diff --git a/database/migrations/2018_07_26_113627_create_Commissioned_table.php b/database/migrations/2018_07_28_175045_create_Commissioned_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_Commissioned_table.php rename to database/migrations/2018_07_28_175045_create_Commissioned_table.php diff --git a/database/migrations/2018_07_26_113627_create_FlightNegotiation_table.php b/database/migrations/2018_07_28_175045_create_FlightNegotiation_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_FlightNegotiation_table.php rename to database/migrations/2018_07_28_175045_create_FlightNegotiation_table.php diff --git a/database/migrations/2018_07_26_113627_create_Manage_table.php b/database/migrations/2018_07_28_175045_create_Manage_table.php similarity index 87% rename from database/migrations/2018_07_26_113627_create_Manage_table.php rename to database/migrations/2018_07_28_175045_create_Manage_table.php index d017ec9..34f8b29 100644 --- a/database/migrations/2018_07_26_113627_create_Manage_table.php +++ b/database/migrations/2018_07_28_175045_create_Manage_table.php @@ -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']); }); } diff --git a/database/migrations/2018_07_26_113627_create_Preference_table.php b/database/migrations/2018_07_28_175045_create_Preference_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_Preference_table.php rename to database/migrations/2018_07_28_175045_create_Preference_table.php diff --git a/database/migrations/2018_07_26_113627_create_PriceNegotiation_table.php b/database/migrations/2018_07_28_175045_create_PriceNegotiation_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_PriceNegotiation_table.php rename to database/migrations/2018_07_28_175045_create_PriceNegotiation_table.php diff --git a/database/migrations/2018_07_26_113627_create_ProofReading_table.php b/database/migrations/2018_07_28_175045_create_ProofReading_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_ProofReading_table.php rename to database/migrations/2018_07_28_175045_create_ProofReading_table.php diff --git a/database/migrations/2018_07_26_113627_create_Receiver_table.php b/database/migrations/2018_07_28_175045_create_Receiver_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_Receiver_table.php rename to database/migrations/2018_07_28_175045_create_Receiver_table.php diff --git a/database/migrations/2018_07_26_113627_create_ReleaseManuscript_table.php b/database/migrations/2018_07_28_175045_create_ReleaseManuscript_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_ReleaseManuscript_table.php rename to database/migrations/2018_07_28_175045_create_ReleaseManuscript_table.php diff --git a/database/migrations/2018_07_26_113627_create_TheCase_table.php b/database/migrations/2018_07_28_175045_create_TheCase_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_TheCase_table.php rename to database/migrations/2018_07_28_175045_create_TheCase_table.php diff --git a/database/migrations/2018_07_26_113627_create_TheClass_table.php b/database/migrations/2018_07_28_175045_create_TheClass_table.php similarity index 100% rename from database/migrations/2018_07_26_113627_create_TheClass_table.php rename to database/migrations/2018_07_28_175045_create_TheClass_table.php diff --git a/database/migrations/2018_07_26_113629_add_foreign_keys_to_BeClassifiedAs_table.php b/database/migrations/2018_07_28_175046_add_foreign_keys_to_BeClassifiedAs_table.php similarity index 56% rename from database/migrations/2018_07_26_113629_add_foreign_keys_to_BeClassifiedAs_table.php rename to database/migrations/2018_07_28_175046_add_foreign_keys_to_BeClassifiedAs_table.php index 14c3df6..228cbbb 100644 --- a/database/migrations/2018_07_26_113629_add_foreign_keys_to_BeClassifiedAs_table.php +++ b/database/migrations/2018_07_28_175046_add_foreign_keys_to_BeClassifiedAs_table.php @@ -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'); }); } diff --git a/database/migrations/2018_07_26_113629_add_foreign_keys_to_Belong_table.php b/database/migrations/2018_07_28_175046_add_foreign_keys_to_Belong_table.php similarity index 58% rename from database/migrations/2018_07_26_113629_add_foreign_keys_to_Belong_table.php rename to database/migrations/2018_07_28_175046_add_foreign_keys_to_Belong_table.php index da8994d..dc32cb0 100644 --- a/database/migrations/2018_07_26_113629_add_foreign_keys_to_Belong_table.php +++ b/database/migrations/2018_07_28_175046_add_foreign_keys_to_Belong_table.php @@ -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'); }); } diff --git a/database/migrations/2018_07_26_113629_add_foreign_keys_to_Commissioned_table.php b/database/migrations/2018_07_28_175046_add_foreign_keys_to_Commissioned_table.php similarity index 57% rename from database/migrations/2018_07_26_113629_add_foreign_keys_to_Commissioned_table.php rename to database/migrations/2018_07_28_175046_add_foreign_keys_to_Commissioned_table.php index 4e9571f..15a52ec 100644 --- a/database/migrations/2018_07_26_113629_add_foreign_keys_to_Commissioned_table.php +++ b/database/migrations/2018_07_28_175046_add_foreign_keys_to_Commissioned_table.php @@ -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'); }); } diff --git a/database/migrations/2018_07_26_113629_add_foreign_keys_to_FlightNegotiation_table.php b/database/migrations/2018_07_28_175046_add_foreign_keys_to_FlightNegotiation_table.php similarity index 72% rename from database/migrations/2018_07_26_113629_add_foreign_keys_to_FlightNegotiation_table.php rename to database/migrations/2018_07_28_175046_add_foreign_keys_to_FlightNegotiation_table.php index 1b79cca..b7fa815 100644 --- a/database/migrations/2018_07_26_113629_add_foreign_keys_to_FlightNegotiation_table.php +++ b/database/migrations/2018_07_28_175046_add_foreign_keys_to_FlightNegotiation_table.php @@ -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'); }); } diff --git a/database/migrations/2018_07_26_113629_add_foreign_keys_to_Manage_table.php b/database/migrations/2018_07_28_175046_add_foreign_keys_to_Manage_table.php similarity index 58% rename from database/migrations/2018_07_26_113629_add_foreign_keys_to_Manage_table.php rename to database/migrations/2018_07_28_175046_add_foreign_keys_to_Manage_table.php index 1ceda37..00602ad 100644 --- a/database/migrations/2018_07_26_113629_add_foreign_keys_to_Manage_table.php +++ b/database/migrations/2018_07_28_175046_add_foreign_keys_to_Manage_table.php @@ -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'); }); } diff --git a/database/migrations/2018_07_26_113629_add_foreign_keys_to_Preference_table.php b/database/migrations/2018_07_28_175046_add_foreign_keys_to_Preference_table.php similarity index 57% rename from database/migrations/2018_07_26_113629_add_foreign_keys_to_Preference_table.php rename to database/migrations/2018_07_28_175046_add_foreign_keys_to_Preference_table.php index aa5c83d..01bcc3e 100644 --- a/database/migrations/2018_07_26_113629_add_foreign_keys_to_Preference_table.php +++ b/database/migrations/2018_07_28_175046_add_foreign_keys_to_Preference_table.php @@ -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'); }); } diff --git a/database/migrations/2018_07_26_113629_add_foreign_keys_to_PriceNegotiation_table.php b/database/migrations/2018_07_28_175046_add_foreign_keys_to_PriceNegotiation_table.php similarity index 72% rename from database/migrations/2018_07_26_113629_add_foreign_keys_to_PriceNegotiation_table.php rename to database/migrations/2018_07_28_175046_add_foreign_keys_to_PriceNegotiation_table.php index 2a6bed8..4872b18 100644 --- a/database/migrations/2018_07_26_113629_add_foreign_keys_to_PriceNegotiation_table.php +++ b/database/migrations/2018_07_28_175046_add_foreign_keys_to_PriceNegotiation_table.php @@ -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'); }); } diff --git a/database/migrations/2018_07_26_113629_add_foreign_keys_to_ProofReading_table.php b/database/migrations/2018_07_28_175046_add_foreign_keys_to_ProofReading_table.php similarity index 72% rename from database/migrations/2018_07_26_113629_add_foreign_keys_to_ProofReading_table.php rename to database/migrations/2018_07_28_175046_add_foreign_keys_to_ProofReading_table.php index 1c6f663..ac3deaf 100644 --- a/database/migrations/2018_07_26_113629_add_foreign_keys_to_ProofReading_table.php +++ b/database/migrations/2018_07_28_175046_add_foreign_keys_to_ProofReading_table.php @@ -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'); }); } diff --git a/database/migrations/2018_07_26_113629_add_foreign_keys_to_ReleaseManuscript_table.php b/database/migrations/2018_07_28_175046_add_foreign_keys_to_ReleaseManuscript_table.php similarity index 72% rename from database/migrations/2018_07_26_113629_add_foreign_keys_to_ReleaseManuscript_table.php rename to database/migrations/2018_07_28_175046_add_foreign_keys_to_ReleaseManuscript_table.php index ad58621..2630432 100644 --- a/database/migrations/2018_07_26_113629_add_foreign_keys_to_ReleaseManuscript_table.php +++ b/database/migrations/2018_07_28_175046_add_foreign_keys_to_ReleaseManuscript_table.php @@ -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'); }); } diff --git a/database/migrations/2018_07_26_113629_add_foreign_keys_to_TheCase_table.php b/database/migrations/2018_07_28_175046_add_foreign_keys_to_TheCase_table.php similarity index 72% rename from database/migrations/2018_07_26_113629_add_foreign_keys_to_TheCase_table.php rename to database/migrations/2018_07_28_175046_add_foreign_keys_to_TheCase_table.php index b5a31ff..d057ac1 100644 --- a/database/migrations/2018_07_26_113629_add_foreign_keys_to_TheCase_table.php +++ b/database/migrations/2018_07_28_175046_add_foreign_keys_to_TheCase_table.php @@ -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'); }); }