2022_03_17_144518_create_components_table.php
1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateComponentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('video_temp');
Schema::create('video_temp', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->unsignedTinyInteger('state');
$table->timestamps();
});
Schema::create('components', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('temp_id');
$table->string('name')->comment('组件名称');
$table->string('position')->nullable()->comment('位置');
$table->unsignedTinyInteger('font_size')->default(12)->comment('字号');
$table->string('text_color')->nullable()->comment('文字颜色');
$table->string('text_bg_color')->nullable()->comment('文字背景色');
$table->double('opacity')->nullable()->comment('透明度');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('components');
}
}