1 | <?php |
||
9 | class CreateOrdersTable extends Migration |
||
10 | { |
||
11 | /** |
||
12 | * Run the migrations. |
||
13 | */ |
||
14 | public function up() |
||
15 | { |
||
16 | Schema::create('orders', function (Blueprint $table) { |
||
17 | $table->integer('id', true); |
||
18 | |||
19 | $table->integer('employee_id')->nullable()->index('employee_id_2'); |
||
20 | $table->integer('customer_id')->nullable()->index('customer_id_2'); |
||
21 | $table->dateTime('order_date')->nullable(); |
||
22 | $table->dateTime('shipped_date')->nullable(); |
||
23 | $table->integer('shipper_id')->nullable()->index('shipper_id_2'); |
||
24 | $table->string('ship_name', 50)->nullable(); |
||
25 | $table->text('ship_address')->nullable(); |
||
26 | $table->string('ship_city', 50)->nullable(); |
||
27 | $table->string('ship_state_province', 50)->nullable(); |
||
28 | $table->string('ship_zip_postal_code', 50)->nullable()->index('ship_zip_postal_code'); |
||
29 | $table->string('ship_country_region', 50)->nullable(); |
||
30 | $table->decimal('shipping_fee', 19, 4)->nullable()->default(0.0000); |
||
31 | $table->decimal('taxes', 19, 4)->nullable()->default(0.0000); |
||
32 | $table->string('payment_type', 50)->nullable(); |
||
33 | $table->dateTime('paid_date')->nullable(); |
||
34 | $table->text('notes')->nullable(); |
||
35 | $table->float('tax_rate', 10, 0)->nullable()->default(0); |
||
36 | $table->boolean('tax_status_id')->nullable()->index('tax_status'); |
||
37 | $table->boolean('status_id')->nullable()->default(0)->index('fk_orders_orders_status1'); |
||
38 | }); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Reverse the migrations. |
||
43 | */ |
||
44 | public function down() |
||
45 | { |
||
46 | if (Schema::hasTable('orders')) { |
||
47 | Schema::drop('orders'); |
||
48 | } |
||
49 | } |
||
50 | } |
||
51 |