添加字段

This commit is contained in:
邓皓元 2018-12-11 17:43:05 +08:00
parent 7508fcbc42
commit a5baec4f2e
3 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddPackageIdProductIdToVirtualProducts extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table("virtual_orders", function (Blueprint $table) {
$table->integer('package_id')->unsigned()->default(0)->after('company_id')->comment('套餐ID');
$table->integer('product_id')->unsigned()->default(0)->after('package_id')->comment('定价ID');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table("virtual_orders", function (Blueprint $table) {
$table->dropColumn('package_id');
$table->dropColumn('product_id');
});
}
}

View File

@ -7,6 +7,7 @@ $baseDir = dirname($vendorDir);
return array(
'AccountSeeder' => $baseDir . '/database/seeds/AccountSeeder.php',
'AddPackageIdProductIdToVirtualProducts' => $baseDir . '/database/migrations/2018_12_11_173842_add_package_id_product_id_to_virtual_products.php',
'ArithmeticError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
'AssertionError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',
'CompanyAccountSeeder' => $baseDir . '/database/seeds/CompanyAccountSeeder.php',

View File

@ -696,6 +696,7 @@ class ComposerStaticInite79258a3e34ad3e251999111d9f334d9
public static $classMap = array (
'AccountSeeder' => __DIR__ . '/../..' . '/database/seeds/AccountSeeder.php',
'AddPackageIdProductIdToVirtualProducts' => __DIR__ . '/../..' . '/database/migrations/2018_12_11_173842_add_package_id_product_id_to_virtual_products.php',
'ArithmeticError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
'AssertionError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',
'CompanyAccountSeeder' => __DIR__ . '/../..' . '/database/seeds/CompanyAccountSeeder.php',