aboutsummaryrefslogtreecommitdiffhomepage
path: root/main/app/system/Database
diff options
context:
space:
mode:
authormarvin-borner@live.com2018-04-16 21:09:05 +0200
committermarvin-borner@live.com2018-04-16 21:09:05 +0200
commitcf14306c2b3f82a81f8d56669a71633b4d4b5fce (patch)
tree86700651aa180026e89a66064b0364b1e4346f3f /main/app/system/Database
parent619b01b3615458c4ed78bfaeabb6b1a47cc8ad8b (diff)
Main merge to user management system - files are now at /main/public/
Diffstat (limited to 'main/app/system/Database')
-rwxr-xr-xmain/app/system/Database/Migrations/v410/MigrationTable.php59
-rwxr-xr-xmain/app/system/Database/Model/Migrations.php55
2 files changed, 114 insertions, 0 deletions
diff --git a/main/app/system/Database/Migrations/v410/MigrationTable.php b/main/app/system/Database/Migrations/v410/MigrationTable.php
new file mode 100755
index 0000000..fb833df
--- /dev/null
+++ b/main/app/system/Database/Migrations/v410/MigrationTable.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * UserFrosting (http://www.userfrosting.com)
+ *
+ * @link https://github.com/userfrosting/UserFrosting
+ * @license https://github.com/userfrosting/UserFrosting/blob/master/licenses/UserFrosting.md (MIT License)
+ */
+namespace UserFrosting\System\Database\Migrations\v410;
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Schema\Builder;
+use UserFrosting\System\Bakery\Migration;
+
+/**
+ * Migration table migration
+ * Version 4.1.0
+ *
+ * See https://laravel.com/docs/5.4/migrations#tables
+ * @extends Migration
+ * @author Alex Weissman (https://alexanderweissman.com)
+ */
+class MigrationTable extends Migration
+{
+ /**
+ * {@inheritDoc}
+ */
+ public $dependencies = [];
+
+ /**
+ * {@inheritDoc}
+ */
+ public function up()
+ {
+ $this->schema->create('migrations', function (Blueprint $table) {
+ $table->increments('id');
+ $table->string('sprinkle');
+ $table->string('migration');
+ $table->integer('batch');
+ $table->timestamps();
+
+ $table->engine = 'InnoDB';
+ $table->collation = 'utf8_unicode_ci';
+ $table->charset = 'utf8';
+ });
+
+ // Drop the old `version` table if found
+ if ($this->schema->hasTable('version')) {
+ $this->schema->drop('version');
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function down()
+ {
+ $this->schema->drop('migrations');
+ }
+}
diff --git a/main/app/system/Database/Model/Migrations.php b/main/app/system/Database/Model/Migrations.php
new file mode 100755
index 0000000..6a0942e
--- /dev/null
+++ b/main/app/system/Database/Model/Migrations.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * UserFrosting (http://www.userfrosting.com)
+ *
+ * @link https://github.com/userfrosting/UserFrosting
+ * @license https://github.com/userfrosting/UserFrosting/blob/master/licenses/UserFrosting.md (MIT License)
+ */
+namespace UserFrosting\System\Database\Model;
+
+use Illuminate\Database\Capsule\Manager as Capsule;
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * Migration Model
+ *
+ * Represents the model for the `migrations` table
+ *
+ * @author Alex Weissman (https://alexanderweissman.com)
+ * @property string sprinkle
+ * @property string version
+ */
+class Migrations extends Model
+{
+ /**
+ * @var string The name of the table for the current model.
+ */
+ protected $table = "migrations";
+
+ /**
+ * @var bool Enable timestamps for this class.
+ */
+ public $timestamps = true;
+
+ /**
+ * @var array List of fields that can be edited by this model
+ */
+ protected $fillable = [
+ "sprinkle",
+ "migration",
+ "batch"
+ ];
+
+ /**
+ * scopeForSprinkle function.
+ *
+ * @access protected
+ * @param mixed $query
+ * @param string $sprinkleName
+ * @return void
+ */
+ protected function scopeForSprinkle($query, $sprinkleName)
+ {
+ return $query->where('sprinkle', $sprinkleName);
+ }
+}