mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
934afa036f
Shift automatically applies the Laravel coding style - which uses the PSR-2 coding style as a base with some minor additions. You may customize the adopted coding style by adding your own [PHP CS Fixer][1] `.php_cs` config file to your project root. Feel free to use [Shift's Laravel ruleset][2] to help you get started. [1]: https://github.com/FriendsOfPHP/PHP-CS-Fixer [2]: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200
68 lines
2 KiB
PHP
68 lines
2 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
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);
|
|
});
|
|
|
|
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);
|
|
});
|
|
|
|
Schema::table('asset_logs', function ($table) {
|
|
$table->dateTime('requested_at')->nullable()->default(null);
|
|
$table->dateTime('accepted_at')->nullable()->default(null);
|
|
});
|
|
|
|
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();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
//
|
|
Schema::table('settings', function ($table) {
|
|
$table->dropColumn('default_eula_text');
|
|
});
|
|
|
|
Schema::table('categories', function ($table) {
|
|
$table->dropColumn('eula_text');
|
|
$table->dropColumn('use_default_eula');
|
|
$table->dropColumn('require_acceptance');
|
|
});
|
|
|
|
Schema::table('asset_logs', function ($table) {
|
|
$table->dropColumn('requested_at');
|
|
$table->dropColumn('accepted_at');
|
|
});
|
|
|
|
Schema::drop('requested_assets');
|
|
}
|
|
}
|