mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-02-07 13:58:24 +00:00
Add missing unique constraints to the Accounts, Passwords and Aliases tables
This commit is contained in:
parent
85130d454f
commit
81b409677d
2 changed files with 43 additions and 1 deletions
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddUniqueAccountsPasswordsAliasesTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('accounts', function (Blueprint $table) {
|
||||
$table->unique(['username', 'domain']);
|
||||
});
|
||||
|
||||
Schema::table('passwords', function (Blueprint $table) {
|
||||
$table->unique(['account_id', 'algorithm']);
|
||||
});
|
||||
|
||||
Schema::table('aliases', function (Blueprint $table) {
|
||||
$table->unique(['alias', 'domain']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::disableForeignKeyConstraints();
|
||||
|
||||
Schema::table('accounts', function (Blueprint $table) {
|
||||
$table->dropUnique(['username', 'domain']);
|
||||
});
|
||||
|
||||
Schema::table('passwords', function (Blueprint $table) {
|
||||
$table->dropUnique(['account_id', 'algorithm']);
|
||||
});
|
||||
|
||||
Schema::table('aliases', function (Blueprint $table) {
|
||||
$table->dropUnique(['alias', 'domain']);
|
||||
});
|
||||
|
||||
Schema::enableForeignKeyConstraints();
|
||||
}
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
#%define _datadir %{_datarootdir}
|
||||
#%define _docdir %{_datadir}/doc
|
||||
|
||||
%define build_number 102
|
||||
%define build_number 103
|
||||
%define var_dir /var/opt/belledonne-communications
|
||||
%define opt_dir /opt/belledonne-communications/share/flexisip-account-manager
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue