Enabled user registration
This commit is contained in:
@@ -17,7 +17,7 @@ class InitDatabase extends Migration
|
||||
|
||||
Schema::create('modes', function (Blueprint $table) {
|
||||
$table->timestamps();
|
||||
$table->integer('id')->autoIncrement();
|
||||
$table->integer('id')->autoIncrement()->index();
|
||||
$table->string('name',16);
|
||||
$table->string('note',255);
|
||||
|
||||
@@ -25,43 +25,38 @@ class InitDatabase extends Migration
|
||||
});
|
||||
|
||||
Schema::create('cugs', function (Blueprint $table) {
|
||||
$table->timestamps();
|
||||
$table->integer('id');
|
||||
$table->string('name',16);
|
||||
$table->string('note',255);
|
||||
$table->integer('parent_id')->nullable();
|
||||
$table->timestamps();
|
||||
$table->integer('id')->index()->unique();
|
||||
$table->string('name', 16);
|
||||
$table->string('note', 255);
|
||||
$table->integer('parent_id')->nullable()->index();
|
||||
});
|
||||
|
||||
$table->primary('id');
|
||||
Schema::table('cugs', function (Blueprint $table) {
|
||||
$table->foreign('parent_id')->references('id')->on('cugs');
|
||||
$table->unique(['name']);
|
||||
});
|
||||
|
||||
Schema::create('frames', function (Blueprint $table) {
|
||||
$table->timestamps();
|
||||
$table->integer('id')->autoIncrement();
|
||||
$table->integer('frame');
|
||||
$table->char('index',1);
|
||||
$table->integer('mode_id');
|
||||
$table->char('type',2);
|
||||
$table->smallInteger('cost')->default(0);
|
||||
$table->integer('cug_id')->default(0);
|
||||
$table->boolean('public')->default(FALSE);
|
||||
$table->binary('content');
|
||||
$table->string('note',255)->nullable();
|
||||
$table->timestamps();
|
||||
$table->integer('id')->autoIncrement()->index();
|
||||
$table->integer('frame');
|
||||
$table->char('index', 1);
|
||||
$table->integer('mode_id')->index();
|
||||
$table->char('type', 2);
|
||||
$table->smallInteger('cost')->default(0);
|
||||
$table->integer('cug_id')->default(0)->index();
|
||||
$table->boolean('public')->default(FALSE);
|
||||
$table->binary('content');
|
||||
$table->string('note', 255)->nullable();
|
||||
|
||||
//$table->unique(['frame','index','mode_id']); // Not needed since we have timewarp
|
||||
//$table->unique(['frame','index','mode_id']); // Not needed since we have timewarp
|
||||
|
||||
});
|
||||
Schema::table('frames', function (Blueprint $table) {
|
||||
$table->foreign('mode_id')->references('id')->on('modes');
|
||||
$table->foreign('cug_id')->references('id')->on('cugs');
|
||||
});
|
||||
|
||||
Schema::create('routes', function (Blueprint $table) {
|
||||
$table->integer('id')->autoIncrement();
|
||||
$table->char('key',1);
|
||||
$table->integer('route');
|
||||
|
||||
$table->foreign('route')->references('id')->on('frames');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -16,18 +16,21 @@ class CreateFramemeta extends Migration
|
||||
$this->down();
|
||||
|
||||
Schema::create('framemeta', function (Blueprint $table) {
|
||||
$table->integer('frame_id')->primary();
|
||||
$table->string('r0')->default('*');
|
||||
$table->string('r1')->default('*');
|
||||
$table->string('r2')->default('*');
|
||||
$table->string('r3')->default('*');
|
||||
$table->string('r4')->default('*');
|
||||
$table->string('r5')->default('*');
|
||||
$table->string('r6')->default('*');
|
||||
$table->string('r7')->default('*');
|
||||
$table->string('r8')->default('*');
|
||||
$table->string('r9')->default('*');
|
||||
$table->integer('frame_id')->index();
|
||||
$table->string('r0')->default('*');
|
||||
$table->string('r1')->default('*');
|
||||
$table->string('r2')->default('*');
|
||||
$table->string('r3')->default('*');
|
||||
$table->string('r4')->default('*');
|
||||
$table->string('r5')->default('*');
|
||||
$table->string('r6')->default('*');
|
||||
$table->string('r7')->default('*');
|
||||
$table->string('r8')->default('*');
|
||||
$table->string('r9')->default('*');
|
||||
|
||||
});
|
||||
|
||||
Schema::table('framemeta', function (Blueprint $table) {
|
||||
$table->foreign('frame_id')->references('id')->on('frames');
|
||||
});
|
||||
}
|
||||
|
@@ -16,9 +16,11 @@ class CreateUserCug extends Migration
|
||||
$this->down();
|
||||
|
||||
Schema::create('cug_users', function (Blueprint $table) {
|
||||
$table->integer('cug_id');
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->integer('cug_id')->index();
|
||||
$table->integer('user_id')->unsigned()->index();
|
||||
});
|
||||
|
||||
Schema::table('cug_users', function (Blueprint $table) {
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->foreign('cug_id')->references('id')->on('cugs');
|
||||
$table->unique(['user_id','cug_id']);
|
||||
|
@@ -16,9 +16,11 @@ class CreateCugOwners extends Migration
|
||||
$this->down();
|
||||
|
||||
Schema::create('cug_owners', function (Blueprint $table) {
|
||||
$table->integer('cug_id');
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->integer('cug_id')->index();
|
||||
$table->integer('user_id')->unsigned()->index();
|
||||
});
|
||||
|
||||
Schema::table('cug_owners', function (Blueprint $table) {
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->foreign('cug_id')->references('id')->on('cugs');
|
||||
$table->unique(['user_id','cug_id']);
|
||||
|
@@ -14,7 +14,6 @@ class FrameAddAccess extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table('frames', function (Blueprint $table) {
|
||||
$table->renameColumn('public','closed');
|
||||
$table->boolean('access')->default(FALSE);
|
||||
$table->dropForeign(['cug_id']);
|
||||
$table->dropColumn('cug_id');
|
||||
@@ -30,9 +29,8 @@ class FrameAddAccess extends Migration
|
||||
{
|
||||
Schema::table('frames', function (Blueprint $table) {
|
||||
$table->dropColumn('access');
|
||||
$table->renameColumn('closed','public');
|
||||
$table->integer('cug_id')->default(0);
|
||||
$table->foreign('cug_id')->references('id')->on('cugs');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user