2016-03-25 01:18:05 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
2021-06-10 13:15:52 -07:00
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
class AddEulaFields extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
Schema::table('settings', function ($table) {
|
|
|
|
$table->longText('default_eula_text')->nullable()->default(null);
|
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Schema::table('categories', function ($table) {
|
|
|
|
$table->longText('eula_text')->nullable()->default(null);
|
|
|
|
$table->boolean('use_default_eula')->default(0);
|
|
|
|
$table->boolean('require_acceptance')->default(0);
|
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Schema::table('asset_logs', function ($table) {
|
|
|
|
$table->dateTime('requested_at')->nullable()->default(null);
|
|
|
|
$table->dateTime('accepted_at')->nullable()->default(null);
|
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Schema::create('requested_assets', function ($table) {
|
|
|
|
$table->increments('id');
|
|
|
|
$table->integer('asset_id')->default(null);
|
|
|
|
$table->integer('user_id')->default(null);
|
|
|
|
$table->dateTime('accepted_at')->nullable()->default(null);
|
|
|
|
$table->dateTime('denied_at')->nullable()->default(null);
|
|
|
|
$table->string('notes')->default(null);
|
|
|
|
$table->timestamps();
|
|
|
|
});
|
|
|
|
}
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
Schema::table('settings', function ($table) {
|
|
|
|
$table->dropColumn('default_eula_text');
|
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Schema::table('categories', function ($table) {
|
|
|
|
$table->dropColumn('eula_text');
|
|
|
|
$table->dropColumn('use_default_eula');
|
|
|
|
$table->dropColumn('require_acceptance');
|
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Schema::table('asset_logs', function ($table) {
|
|
|
|
$table->dropColumn('requested_at');
|
|
|
|
$table->dropColumn('accepted_at');
|
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Schema::drop('requested_assets');
|
|
|
|
}
|
2016-03-25 01:18:05 -07:00
|
|
|
}
|