Push changes that support creations of service packs and basic listing

This commit is contained in:
Dane Everitt 2016-11-15 20:20:32 -05:00
parent 1f47eda3b3
commit a1bc6fa2d3
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
15 changed files with 654 additions and 49 deletions

View file

@ -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');
}
}

View 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');
}
}

View file

@ -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');
});
}
}