Merge branch 'master' into title-subheading
This commit is contained in:
53
database/migrations/2022_08_29_000000_core_v3015.php
Normal file
53
database/migrations/2022_08_29_000000_core_v3015.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// Documents
|
||||
Schema::table('documents', function(Blueprint $table) {
|
||||
$table->index('contact_id');
|
||||
});
|
||||
|
||||
// User Companies
|
||||
Schema::table('user_companies', function(Blueprint $table) {
|
||||
$table->index('user_id');
|
||||
$table->index('company_id');
|
||||
});
|
||||
|
||||
// User Roles
|
||||
Schema::table('user_roles', function(Blueprint $table) {
|
||||
$table->index('user_id');
|
||||
$table->index('role_id');
|
||||
});
|
||||
|
||||
// Transactions
|
||||
Schema::table('transactions', function(Blueprint $table) {
|
||||
$table->index('number');
|
||||
});
|
||||
|
||||
// Roles
|
||||
Schema::table('roles', function(Blueprint $table) {
|
||||
$table->index('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
64
database/migrations/2023_06_22_000000_core_v3016.php
Normal file
64
database/migrations/2023_06_22_000000_core_v3016.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// Settings
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$connection = Schema::getConnection();
|
||||
$d_table = $connection->getDoctrineSchemaManager()->listTableDetails($connection->getTablePrefix() . 'settings');
|
||||
|
||||
if ($d_table->hasIndex('settings_company_id_key_unique')) {
|
||||
$table->dropUnique('settings_company_id_key_unique');
|
||||
} else {
|
||||
$table->dropUnique(['company_id', 'key']);
|
||||
}
|
||||
|
||||
$table->unique(['company_id', 'key', 'deleted_at']);
|
||||
});
|
||||
|
||||
// User Invitations
|
||||
Schema::table('user_invitations', function (Blueprint $table) {
|
||||
$table->unsignedInteger('created_by')->nullable()->after('token');
|
||||
$table->string('created_from', 100)->nullable()->after('token');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
// Settings
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$connection = Schema::getConnection();
|
||||
$d_table = $connection->getDoctrineSchemaManager()->listTableDetails($connection->getTablePrefix() . 'settings');
|
||||
|
||||
if ($d_table->hasIndex('settings_company_id_key_deleted_at_unique')) {
|
||||
$table->dropUnique('settings_company_id_key_deleted_at_unique');
|
||||
} else {
|
||||
$table->dropUnique(['company_id', 'key', 'deleted_at']);
|
||||
}
|
||||
|
||||
$table->unique(['company_id', 'key']);
|
||||
});
|
||||
|
||||
// User Invitations
|
||||
Schema::table('user_invitations', function (Blueprint $table) {
|
||||
$table->dropColumn('created_by');
|
||||
$table->dropColumn('created_from');
|
||||
});
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user