Explicitly specify length for string columns.

The missing length attributes caused problems with too long indices.
This commit is contained in:
Franz Liedke 2015-05-19 00:20:36 +02:00
parent 5b5a213143
commit 0f8968ee63
8 changed files with 16 additions and 16 deletions

View File

@ -14,7 +14,7 @@ class CreateAccessTokensTable extends Migration {
{
Schema::create('access_tokens', function(Blueprint $table)
{
$table->string('id');
$table->string('id', 100);
$table->integer('user_id')->unsigned();
});
}

View File

@ -17,7 +17,7 @@ class CreateActivityTable extends Migration {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->integer('sender_id')->unsigned()->nullable();
$table->string('type');
$table->string('type', 100);
$table->binary('data')->nullable();
$table->dateTime('time');
});

View File

@ -14,7 +14,7 @@ class CreateConfigTable extends Migration {
{
Schema::create('config', function(Blueprint $table)
{
$table->string('key')->primary();
$table->string('key', 100)->primary();
$table->binary('value')->nullable();
});
}

View File

@ -15,7 +15,7 @@ class CreateDiscussionsTable extends Migration {
Schema::create('discussions', function(Blueprint $table)
{
$table->increments('id');
$table->string('title');
$table->string('title', 200);
$table->integer('comments_count')->unsigned()->default(0);
$table->integer('number_index')->unsigned()->default(0);

View File

@ -14,10 +14,10 @@ class CreateGroupsTable extends Migration
{
Schema::create('groups', function (Blueprint $table) {
$table->increments('id');
$table->string('name_singular');
$table->string('name_plural');
$table->string('color')->nullable();
$table->string('icon')->nullable();
$table->string('name_singular', 100);
$table->string('name_plural', 100);
$table->string('color', 20)->nullable();
$table->string('icon', 100)->nullable();
});
}

View File

@ -17,8 +17,8 @@ class CreateNotificationsTable extends Migration {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->integer('sender_id')->unsigned()->nullable();
$table->string('type');
$table->string('subject_type')->nullable();
$table->string('type', 100);
$table->string('subject_type', 200)->nullable();
$table->integer('subject_id')->unsigned()->nullable();
$table->binary('data')->nullable();
$table->dateTime('time');

View File

@ -20,7 +20,7 @@ class CreatePostsTable extends Migration {
$table->dateTime('time');
$table->integer('user_id')->unsigned()->nullable();
$table->string('type')->nullable();
$table->string('type', 100)->nullable();
$table->text('content')->nullable();
$table->text('content_html')->nullable();

View File

@ -15,15 +15,15 @@ class CreateUsersTable extends Migration {
Schema::create('users', function(Blueprint $table)
{
$table->increments('id');
$table->string('username')->unique();
$table->string('email')->unique();
$table->string('username', 100)->unique();
$table->string('email', 150)->unique();
$table->boolean('is_confirmed')->default(0);
$table->string('confirmation_token')->nullable();
$table->string('confirmation_token', 50)->nullable();
$table->boolean('is_activated')->default(0);
$table->string('password');
$table->string('password', 100);
$table->text('bio')->nullable();
$table->text('bio_html')->nullable();
$table->string('avatar_path')->nullable();
$table->string('avatar_path', 100)->nullable();
$table->binary('preferences')->nullable();
$table->dateTime('join_time')->nullable();
$table->dateTime('last_seen_time')->nullable();