|
@@ -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) {
|
|
|
|
+ //
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+}
|