summaryrefslogtreecommitdiff
path: root/db/migrations/2018_08_30_000000_create_log_entries_table.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-09-16 14:08:09 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-09-25 14:02:55 +0200
commit0b0890f425ced27b2204a046296de4cccdac4eb8 (patch)
tree5b7a697185ca543ef9c0f0959532dfe8bfb9e3f1 /db/migrations/2018_08_30_000000_create_log_entries_table.php
parent104e4f4c437376eb739dd3ef2de603855947a557 (diff)
Session: Added DatabaseHandler, replaces Symfony PdoSessionHandler
Diffstat (limited to 'db/migrations/2018_08_30_000000_create_log_entries_table.php')
-rw-r--r--db/migrations/2018_08_30_000000_create_log_entries_table.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/db/migrations/2018_08_30_000000_create_log_entries_table.php b/db/migrations/2018_08_30_000000_create_log_entries_table.php
index 68815434..bef78712 100644
--- a/db/migrations/2018_08_30_000000_create_log_entries_table.php
+++ b/db/migrations/2018_08_30_000000_create_log_entries_table.php
@@ -17,12 +17,14 @@ class CreateLogEntriesTable extends Migration
$table->timestamp('created_at')->nullable();
});
- $this->schema->getConnection()->unprepared('
- INSERT INTO log_entries (`id`, `level`, `message`, `created_at`)
- SELECT `id`, `level`, `message`, FROM_UNIXTIME(`timestamp`) FROM LogEntries
- ');
+ if ($this->schema->hasTable('LogEntries')) {
+ $this->schema->getConnection()->unprepared('
+ INSERT INTO log_entries (`id`, `level`, `message`, `created_at`)
+ SELECT `id`, `level`, `message`, FROM_UNIXTIME(`timestamp`) FROM LogEntries
+ ');
- $this->schema->dropIfExists('LogEntries');
+ $this->schema->drop('LogEntries');
+ }
}
/**