1: <?php
2:
3: use Illuminate\Database\Migrations\Migration;
4: use Illuminate\Database\Schema\Blueprint;
5: use Illuminate\Database\Capsule\Manager as Capsule;
6:
7: class CreateServersTable extends Migration
8: {
9: /**
10: * Run the migrations.
11: *
12: * @return void
13: */
14: public function up()
15: {
16: Capsule::schema()->create('mail_servers', function (Blueprint $table) {
17: $table->increments('Id');
18:
19: $table->integer('TenantId')->default(0);
20: $table->string('Name')->default('');
21: $table->string('IncomingServer')->default('');
22: $table->integer('IncomingPort')->default(143);
23: $table->boolean('IncomingUseSsl')->default(false);
24: $table->string('OutgoingServer')->default('');
25: $table->integer('OutgoingPort')->default(25);
26: $table->boolean('OutgoingUseSsl')->default(false);
27: $table->string('SmtpAuthType')->default(\Aurora\Modules\Mail\Enums\SmtpAuthType::NoAuthentication);
28: $table->string('SmtpLogin')->default('');
29: $table->string('SmtpPassword')->default(''); // field type encrypted?
30: $table->string('OwnerType')->default(\Aurora\Modules\Mail\Enums\ServerOwnerType::Account);
31: $table->text('Domains')->nullable();
32: $table->boolean('EnableSieve')->default(false);
33: $table->integer('SievePort')->default(4190);
34: $table->boolean('EnableThreading')->default(true);
35: $table->boolean('UseFullEmailAddressAsLogin')->default(true);
36:
37: $table->boolean('SetExternalAccessServers')->default(false);
38: $table->string('ExternalAccessImapServer')->default('');
39: $table->integer('ExternalAccessImapPort')->default(143);
40: $table->integer('ExternalAccessImapAlterPort')->default(0);
41: $table->string('ExternalAccessSmtpServer')->default('');
42: $table->integer('ExternalAccessSmtpPort')->default(25);
43: $table->integer('ExternalAccessSmtpAlterPort')->default(0);
44: $table->string('ExternalAccessPop3Server')->default('');
45: $table->integer('ExternalAccessPop3Port')->default(110);
46: $table->integer('ExternalAccessPop3AlterPort')->default(0);
47:
48: $table->boolean('OAuthEnable')->default(false);
49: $table->string('OAuthName')->default('');
50: $table->string('OAuthType')->default('');
51: $table->string('OAuthIconUrl')->default('');
52:
53: $table->timestamp(\Aurora\System\Classes\Model::CREATED_AT)->nullable();
54: $table->timestamp(\Aurora\System\Classes\Model::UPDATED_AT)->nullable();
55: });
56: }
57:
58: /**
59: * Reverse the migrations.
60: *
61: * @return void
62: */
63: public function down()
64: {
65: Capsule::schema()->dropIfExists('mail_servers');
66: }
67: }
68: