aboutsummaryrefslogtreecommitdiff
path: root/src/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'src/migrations')
-rw-r--r--src/migrations/2015_02_23_184402_botleaguesapi-create_users.php1
-rw-r--r--src/migrations/2015_04_26_192015_botleaguesapi-create_competition_types.php34
-rw-r--r--src/migrations/2015_04_26_192025_botleaguesapi-create_competitions.php41
-rw-r--r--src/migrations/2015_04_26_192035_botleaguesapi-create_participants.php36
4 files changed, 112 insertions, 0 deletions
diff --git a/src/migrations/2015_02_23_184402_botleaguesapi-create_users.php b/src/migrations/2015_02_23_184402_botleaguesapi-create_users.php
index b768180..b054a43 100644
--- a/src/migrations/2015_02_23_184402_botleaguesapi-create_users.php
+++ b/src/migrations/2015_02_23_184402_botleaguesapi-create_users.php
@@ -18,6 +18,7 @@ class BotleaguesapiCreateUsers extends Migration {
$table->string('email', 127)->unique();
$table->string('password', 60);
$table->rememberToken();
+ $table->boolean('isAdministrator')->default(false);
$table->timestamps();
});
}
diff --git a/src/migrations/2015_04_26_192015_botleaguesapi-create_competition_types.php b/src/migrations/2015_04_26_192015_botleaguesapi-create_competition_types.php
new file mode 100644
index 0000000..280bb6d
--- /dev/null
+++ b/src/migrations/2015_04_26_192015_botleaguesapi-create_competition_types.php
@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class BotleaguesapiCreateCompetitionTypes extends Migration {
+
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::create('competition_types', function(Blueprint $table)
+ {
+ $table->increments('type');
+ $table->string('description');
+ $table->mediumText('explanation');
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('competition_types');
+ }
+
+}
diff --git a/src/migrations/2015_04_26_192025_botleaguesapi-create_competitions.php b/src/migrations/2015_04_26_192025_botleaguesapi-create_competitions.php
new file mode 100644
index 0000000..8652086
--- /dev/null
+++ b/src/migrations/2015_04_26_192025_botleaguesapi-create_competitions.php
@@ -0,0 +1,41 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class BotleaguesapiCreateCompetitions extends Migration {
+
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::create('competitions', function(Blueprint $table)
+ {
+ $table->increments('id')->unsigned();
+ $table->integer('gameId')->unsigned();
+ $table->foreign('gameId')->references('id')->on('games');
+ $table->string('title', 127)->unique();
+ $table->mediumText('description')->nullable();
+ $table->integer('competition_type')->unsigned();
+ $table->foreign('competition_type')->references('type')->on('competition_types');
+ $table->dateTime('start');
+ $table->dateTime('end');
+ $table->mediumInteger('max_players')->unsigned();
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('competitions');
+ }
+
+}
diff --git a/src/migrations/2015_04_26_192035_botleaguesapi-create_participants.php b/src/migrations/2015_04_26_192035_botleaguesapi-create_participants.php
new file mode 100644
index 0000000..9b76316
--- /dev/null
+++ b/src/migrations/2015_04_26_192035_botleaguesapi-create_participants.php
@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class BotleaguesapiCreateParticipants extends Migration {
+
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::create('participants', function(Blueprint $table)
+ {
+ $table->increments('id');
+ $table->integer('botId')->unsigned();
+ $table->foreign('botId')->references('id')->on('bots');
+ $table->integer('competitionId')->unsigned();
+ $table->foreign('competitionId')->references('id')->on('competitions');
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('participants');
+ }
+
+}