xielin před 5 roky
rodič
revize
5a12638d53

+ 40 - 0
database/migrations/2019_11_04_023522_add_column_lat_and_long_to_post.php

@@ -0,0 +1,40 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddColumnLatAndLongToPost extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('post', function (Blueprint $table) {
+            //
+            $table->decimal('lng',12,8)
+                ->after('location')
+                ->default(0)
+                ->comment('经度');
+            $table->decimal('lat',12,8)
+                ->after('long')
+                ->default(0)
+                ->comment('维度');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('post', function (Blueprint $table) {
+            //
+        });
+    }
+}