summaryrefslogtreecommitdiff
path: root/db/migrations/2018_01_01_000002_import_update_sql.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-08-30 16:07:50 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-08-30 16:07:50 +0200
commit2bebbeb1919e1d370ac5c0668e0db5ea63e73292 (patch)
tree759d675b621eed86b20f14abe448e83fa8d22562 /db/migrations/2018_01_01_000002_import_update_sql.php
parent175c335810817ff3e989f368889274d3f09c08b1 (diff)
Installation: Added migrations for install.sql and update.sql files
Diffstat (limited to 'db/migrations/2018_01_01_000002_import_update_sql.php')
-rw-r--r--db/migrations/2018_01_01_000002_import_update_sql.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/db/migrations/2018_01_01_000002_import_update_sql.php b/db/migrations/2018_01_01_000002_import_update_sql.php
new file mode 100644
index 00000000..58687d6c
--- /dev/null
+++ b/db/migrations/2018_01_01_000002_import_update_sql.php
@@ -0,0 +1,27 @@
+<?php
+
+use Engelsystem\Database\Migration\Migration;
+
+class ImportUpdateSql extends Migration
+{
+ /**
+ * Run the migration
+ */
+ public function up()
+ {
+ if ($this->schema->hasTable('UserWorkLog')) {
+ return;
+ }
+
+ $sql = file_get_contents(__DIR__ . '/../update.sql');
+ $this->schema->getConnection()->unprepared($sql);
+ }
+
+ /**
+ * Reverse the migration
+ */
+ public function down()
+ {
+ $this->schema->dropIfExists('UserWorkLog');
+ }
+}