Push changes that support creations of service packs and basic listing
This commit is contained in:
parent
1f47eda3b3
commit
a1bc6fa2d3
15 changed files with 654 additions and 49 deletions
|
@ -1,36 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddChecksumsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('checksums', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('service')->unsigned();
|
||||
$table->string('filename');
|
||||
$table->char('checksum', 40);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('service')->references('id')->on('services');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('checksums');
|
||||
}
|
||||
}
|
46
database/migrations/2016_11_11_220649_add_pack_support.php
Normal file
46
database/migrations/2016_11_11_220649_add_pack_support.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddPackSupport extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('service_packs', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('option');
|
||||
$table->char('uuid', 36)->unique();
|
||||
$table->unsignedInteger('build_memory')->nullable();
|
||||
$table->unsignedInteger('build_swap')->nullable();
|
||||
$table->unsignedInteger('build_cpu')->nullable();
|
||||
$table->unsignedInteger('build_io')->nullable();
|
||||
$table->text('build_script')->nullable();
|
||||
$table->string('build_container')->default('alpine:latest');
|
||||
$table->string('name');
|
||||
$table->string('version');
|
||||
$table->text('description')->nullable();
|
||||
$table->boolean('selectable')->default(true);
|
||||
$table->boolean('visible')->default(true);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('option')->references('id')->on('service_options');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('service_packs');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class SetServiceNameUnique extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('services', function (Blueprint $table) {
|
||||
$table->unique('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('services', function (Blueprint $table) {
|
||||
$table->dropUnique('services_name_unique');
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue