aboutsummaryrefslogtreecommitdiff
path: root/src/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'src/migrations')
-rw-r--r--src/migrations/2015_02_20_210536_create_users.php (renamed from src/migrations/2015_02_20_210536_create_user.php)10
-rw-r--r--src/migrations/2015_02_20_211306_create_games.php (renamed from src/migrations/2015_02_20_211306_create_game.php)6
-rw-r--r--src/migrations/2015_02_20_211317_create_bots.php (renamed from src/migrations/2015_02_20_211317_create_bot.php)13
3 files changed, 17 insertions, 12 deletions
diff --git a/src/migrations/2015_02_20_210536_create_user.php b/src/migrations/2015_02_20_210536_create_users.php
index 39ff9e1..baf6c19 100644
--- a/src/migrations/2015_02_20_210536_create_user.php
+++ b/src/migrations/2015_02_20_210536_create_users.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
-class CreateUser extends Migration {
+class CreateUsers extends Migration {
/**
* Run the migrations.
@@ -12,11 +12,13 @@ class CreateUser extends Migration {
*/
public function up()
{
- Schema::create('user', function(Blueprint $table)
+ Schema::create('users', function(Blueprint $table)
{
$table->increments('id')->unsigned();
$table->string('email', 127)->unique();
- $table->string('password', 255);
+ $table->string('password', 60);
+ $table->rememberToken();
+ $table->string('key', 255);
$table->timestamps();
});
}
@@ -28,7 +30,7 @@ class CreateUser extends Migration {
*/
public function down()
{
- Schema::drop('user');
+ Schema::drop('users');
}
}
diff --git a/src/migrations/2015_02_20_211306_create_game.php b/src/migrations/2015_02_20_211306_create_games.php
index 7fd5db5..5466404 100644
--- a/src/migrations/2015_02_20_211306_create_game.php
+++ b/src/migrations/2015_02_20_211306_create_games.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
-class CreateGame extends Migration {
+class CreateGames extends Migration {
/**
* Run the migrations.
@@ -12,7 +12,7 @@ class CreateGame extends Migration {
*/
public function up()
{
- Schema::create('game', function(Blueprint $table)
+ Schema::create('games', function(Blueprint $table)
{
$table->increments('id')->unsigned();
$table->string('title')->unique();
@@ -27,7 +27,7 @@ class CreateGame extends Migration {
*/
public function down()
{
- Schema::drop('game');
+ Schema::drop('games');
}
}
diff --git a/src/migrations/2015_02_20_211317_create_bot.php b/src/migrations/2015_02_20_211317_create_bots.php
index 86285a7..665ce0f 100644
--- a/src/migrations/2015_02_20_211317_create_bot.php
+++ b/src/migrations/2015_02_20_211317_create_bots.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
-class CreateBot extends Migration {
+class CreateBots extends Migration {
/**
* Run the migrations.
@@ -12,13 +12,16 @@ class CreateBot extends Migration {
*/
public function up()
{
- Schema::create('bot', function(Blueprint $table)
+ Schema::create('bots', function(Blueprint $table)
{
$table->increments('id')->unsigned();
$table->integer('userId')->unsigned();
- $table->foreign('userId')->references('id')->on('user');
+ $table->foreign('userId')->references('id')->on('users');
$table->integer('gameId')->unsigned();
- $table->foreign('gameId')->references('id')->on('game');
+ $table->foreign('gameId')->references('id')->on('games');
+ $table->string('title', 45);
+ $table->string('version', 12);
+ $table->unique(array('gameId', 'title', 'version'));
$table->timestamps();
});
}
@@ -30,7 +33,7 @@ class CreateBot extends Migration {
*/
public function down()
{
- Schema::drop('bot');
+ Schema::drop('bots');
}
}