소스 검색

表字段新增与修改

durong 5 년 전
부모
커밋
c11e308a38

+ 17 - 0
app/Models/PostMusicUser.php

@@ -0,0 +1,17 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Administrator
+ * Date: 2019-07-09
+ * Time: 15:47
+ */
+
+namespace App\Models;
+
+
+use Illuminate\Database\Eloquent\Model;
+
+class PostMusicUser extends Model {
+    protected $table = 'post_music_user';
+    protected $guarded = [];
+}

+ 35 - 0
database/migrations/2019_07_08_173223_create_post_music_user.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreatePostMusicUser extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('post_music_user', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->string('url')->default('')->comment('音乐地址');
+            $table->string('name',100)->comment('音乐名称');
+            $table->string('username',100)->default('')->comment('上传用户');
+            $table->integer('uid')->comment('上传用户ID');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('table_post_music_user');
+    }
+}

+ 34 - 0
database/migrations/2019_07_09_142246_add_is_open_to_post_music_category_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddIsOpenToPostMusicCategoryTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('post_music_category', function (Blueprint $table) {
+            $table->tinyInteger('is_open')
+                ->default(0)
+                ->comment('是否开启:0.否,1.是');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('post_music_category', function (Blueprint $table) {
+            //
+        });
+    }
+}