mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-05-07 05:53:07 +00:00
Add support for MySQL 5.5
Enable foreign key support for the external schema Bump version
This commit is contained in:
parent
ad69828d60
commit
0279acca0c
12 changed files with 34 additions and 18 deletions
|
|
@ -9,9 +9,9 @@ class CreateUsersTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::connection('local')->create('users', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->string('email', 160)->unique(); // Because we (still) need to support MySQL 5.5 and its 767 bytes limit ¯\_(ツ)_/¯
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class CreateFailedJobsTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::connection('local')->create('failed_jobs', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->increments('id');
|
||||
$table->text('connection');
|
||||
$table->text('queue');
|
||||
$table->longText('payload');
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class CreateAccountsPasswordsTables extends Migration
|
|||
{
|
||||
if (!Schema::connection('external')->hasTable('accounts')) {
|
||||
Schema::connection('external')->create('accounts', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->increments('id');
|
||||
$table->string('username', 64);
|
||||
$table->string('domain', 64);
|
||||
$table->string('email', 64)->nullable();
|
||||
|
|
@ -43,13 +43,13 @@ class CreateAccountsPasswordsTables extends Migration
|
|||
|
||||
if (!Schema::connection('external')->hasTable('passwords')) {
|
||||
Schema::connection('external')->create('passwords', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->increments('id');
|
||||
$table->integer('account_id')->unsigned();
|
||||
$table->string('password', 255);
|
||||
$table->string('algorithm', 10)->default('MD5');
|
||||
|
||||
//$table->foreign('account_id')->references('id')
|
||||
// ->on('accounts')->onDelete('cascade');
|
||||
$table->foreign('account_id')->references('id')
|
||||
->on('accounts')->onDelete('cascade');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -26,11 +26,14 @@ class CreateNoncesDigestTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::connection('local')->create('nonces', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->increments('id');
|
||||
$table->integer('account_id')->unsigned();
|
||||
$table->string('nonce');
|
||||
$table->integer('nc')->default(0);
|
||||
$table->timestamps();
|
||||
|
||||
//$table->foreign('account_id')->references('id')
|
||||
// ->on('accounts')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,12 @@ class CreateAdminsTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::connection('local')->create('admins', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->increments('id');
|
||||
$table->integer('account_id')->unsigned();
|
||||
$table->timestamps();
|
||||
|
||||
//$table->foreign('account_id')->references('id')
|
||||
// ->on('accounts')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,11 +26,14 @@ class AddEmailChangedTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::connection('local')->create('email_changed', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->increments('id');
|
||||
$table->integer('account_id')->unsigned()->unique();
|
||||
$table->string('new_email');
|
||||
$table->string('hash');
|
||||
$table->timestamps();
|
||||
|
||||
//$table->foreign('account_id')->references('id')
|
||||
// ->on('accounts')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,15 +26,18 @@ class CreateApiKeysTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::connection('local')->create('api_keys', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->increments('id');
|
||||
$table->integer('account_id')->unsigned()->unique();
|
||||
$table->string('key')->unique();
|
||||
$table->string('key', 160)->unique(); // MySQL 5.5 limit…
|
||||
$table->timestamps();
|
||||
|
||||
//$table->foreign('account_id')->references('id')
|
||||
// ->on('accounts')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('api_keys');
|
||||
Schema::connection('local')->dropIfExists('api_keys');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class CreateAliasesTable extends Migration
|
|||
$table->string('domain', 64);
|
||||
|
||||
$table->foreign('account_id')->references('id')
|
||||
->on('accounts')->onDelete('cascade');
|
||||
->on('accounts')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,11 +9,14 @@ class AddPhoneChangeCodesTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::connection('local')->create('phone_change_codes', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->increments('id');
|
||||
$table->integer('account_id')->unsigned();
|
||||
$table->string('code');
|
||||
$table->string('phone');
|
||||
$table->timestamps();
|
||||
|
||||
//$table->foreign('account_id')->references('id')
|
||||
// ->on('accounts')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ class CreateActivationExpirationsTable extends Migration
|
|||
$table->integer('account_id')->unsigned();
|
||||
$table->dateTime('expires');
|
||||
$table->timestamps();
|
||||
|
||||
//$table->foreign('account_id')->references('id')
|
||||
// ->on('accounts')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@
|
|||
<server name="APP_ENV" value="testing"/>
|
||||
<server name="BCRYPT_ROUNDS" value="4"/>
|
||||
<server name="CACHE_DRIVER" value="array"/>
|
||||
<server name="DB_DRIVER" value="sqlite"/>
|
||||
<server name="DB_DATABASE" value=":memory:"/>
|
||||
<server name="DB_EXTERNAL_DRIVER" value="sqlite"/>
|
||||
<server name="DB_EXTERNAL_DATABASE" value=":memory:"/>
|
||||
<server name="MAIL_DRIVER" value="array"/>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#%define _datadir %{_datarootdir}
|
||||
#%define _docdir %{_datadir}/doc
|
||||
|
||||
%define build_number 71
|
||||
%define build_number 72
|
||||
%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