-
Notifications
You must be signed in to change notification settings - Fork 1
/
VolumeSchemaMigration.inc.php
43 lines (38 loc) · 1.16 KB
/
VolumeSchemaMigration.inc.php
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
<?php
/**
* @file classes/migration/VolumeSchemaMigration.inc.php
*
* @class VolumeSchemaMigration
* @brief Describe database table structures.
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Builder;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Capsule\Manager as Capsule;
class VolumeSchemaMigration extends Migration
{
/**
* Run the migrations.
* @return void
*/
public function up()
{
// Volumes.
Capsule::schema()->create('volumes', function (Blueprint $table) {
$table->bigInteger('volume_id')->autoIncrement();
$table->bigInteger('context_id');
$table->string('path', 255);
$table->text('image')->nullable();
});
// Volume Settings.
Capsule::schema()->create('volume_settings', function (Blueprint $table) {
$table->bigInteger('volume_id');
$table->string('locale', 14)->default('');
$table->string('setting_name', 255);
$table->longText('setting_value')->nullable();
$table->string('setting_type', 6)->comment('string');
$table->index(['volume_id'], 'volume_settings_id');
$table->unique(['volume_id', 'locale', 'setting_name'], 'volume_settings_pkey');
});
}
}