shared dashboards
This commit is contained in:
@ -16,7 +16,6 @@ class CreateDashboardsTable extends Migration
|
||||
Schema::create('dashboards', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('company_id');
|
||||
$table->integer('user_id');
|
||||
$table->string('name');
|
||||
$table->boolean('enabled')->default(1);
|
||||
$table->timestamps();
|
||||
@ -25,6 +24,14 @@ class CreateDashboardsTable extends Migration
|
||||
$table->index(['company_id']);
|
||||
});
|
||||
|
||||
Schema::create('user_dashboards', function (Blueprint $table) {
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->integer('dashboard_id')->unsigned();
|
||||
$table->string('user_type', 20);
|
||||
|
||||
$table->primary(['user_id', 'dashboard_id', 'user_type']);
|
||||
});
|
||||
|
||||
Schema::create('widgets', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('company_id');
|
||||
@ -36,7 +43,7 @@ class CreateDashboardsTable extends Migration
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->index(['company_id']);
|
||||
$table->index(['company_id', 'dashboard_id']);
|
||||
});
|
||||
}
|
||||
|
||||
@ -48,6 +55,7 @@ class CreateDashboardsTable extends Migration
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('dashboards');
|
||||
Schema::drop('user_dashboards');
|
||||
Schema::drop('widgets');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user