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 CreateIdentitiesTable extends Migration
8: {
9: /**
10: * Run the migrations.
11: *
12: * @return void
13: */
14: public function up()
15: {
16: Capsule::schema()->create('mail_identities', function (Blueprint $table) {
17: $table->increments('Id');
18:
19: $table->integer('IdUser')->default(0);
20: $table->integer('IdAccount')->default(0);
21: $table->boolean('Default')->default(false);
22: $table->string('Email')->default('');
23: $table->string('FriendlyName')->default('');
24: $table->boolean('UseSignature')->default(false);
25: });
26:
27: $prefix = Capsule::connection()->getTablePrefix();
28: Capsule::statement("ALTER TABLE {$prefix}mail_identities ADD Signature MEDIUMBLOB");
29:
30: Capsule::schema()->table('mail_identities', function (Blueprint $table) {
31: $table->timestamp(\Aurora\System\Classes\Model::CREATED_AT)->nullable();
32: $table->timestamp(\Aurora\System\Classes\Model::UPDATED_AT)->nullable();
33: });
34: }
35:
36: /**
37: * Reverse the migrations.
38: *
39: * @return void
40: */
41: public function down()
42: {
43: Capsule::schema()->dropIfExists('mail_identities');
44: }
45: }
46: