Skip to content
This repository was archived by the owner on Nov 21, 2022. It is now read-only.

Commit e51040d

Browse files
committed
Added compatibility with SQLite databases.
1 parent ba1c58e commit e51040d

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

src/database/migrations/2015_07_31_1_email_log.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ class EmailLog extends Migration
1313
public function up()
1414
{
1515
Schema::create('email_log', function (Blueprint $table) {
16+
$table->increments('id');
1617
$table->dateTime('date');
17-
$table->string('to');
18+
$table->string('from')->nullable();
19+
$table->string('to')->nullable();
20+
$table->string('cc')->nullable();
21+
$table->string('bcc')->nullable();
1822
$table->string('subject');
1923
$table->text('body');
24+
$table->text('headers')->nullable();
25+
$table->text('attachments')->nullable();
2026
});
2127
}
2228

src/database/migrations/2016_09_21_001638_add_bcc_column_email_log.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ class AddBccColumnEmailLog extends Migration
1212
public function up()
1313
{
1414
Schema::table('email_log', function ($table) {
15-
$table->string('to')->nullable()->change();
16-
$table->string('bcc')->after('to')->nullable();
15+
if (!Schema::hasColumn('email_log', 'bcc')) {
16+
$table->string('to')->nullable()->change();
17+
$table->string('bcc')->after('to')->nullable();
18+
}
1719
});
1820
}
1921

src/database/migrations/2017_11_10_001638_add_more_mail_columns_email_log.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ class AddMoreMailColumnsEmailLog extends Migration
1212
public function up()
1313
{
1414
Schema::table('email_log', function ($table) {
15-
$table->increments('id')->first();
16-
$table->string('from')->after('date')->nullable();
17-
$table->string('cc')->after('to')->nullable();
18-
$table->text('headers')->after('body')->nullable();
19-
$table->text('attachments')->after('headers')->nullable();
15+
if (!Schema::hasColumn('email_log', 'id')) {
16+
$table->increments('id')->first();
17+
$table->string('from')->after('date')->nullable();
18+
$table->string('cc')->after('to')->nullable();
19+
$table->text('headers')->after('body')->nullable();
20+
$table->text('attachments')->after('headers')->nullable();
21+
}
2022
});
2123
}
2224

0 commit comments

Comments
 (0)