浏览代码

Merge branch 'develop'

xielin 5 年之前
父节点
当前提交
a0c1fdfb11
共有 1 个文件被更改,包括 39 次插入0 次删除
  1. 39 0
      database/migrations/2019_11_04_023522_add_column_lat_and_long_to_post.php

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

@@ -0,0 +1,39 @@
+<?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('lng')
+                ->default(0)
+                ->comment('维度');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('post', function (Blueprint $table) {
+            //
+        });
+    }
+}