Skip to content

Commit e9dd0e8

Browse files
committed
Adding database folder
1 parent 339743b commit e9dd0e8

32 files changed

+1046
-0
lines changed
File renamed without changes.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
6+
class CreateUsersTables extends Migration {
7+
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::create('users', function(Blueprint $table) {
16+
$table->string('uniqueId', 10);
17+
$table->primary('uniqueId');
18+
$table->string('username')->unique();
19+
$table->string('password');
20+
$table->string('firstName')->index();
21+
$table->string('lastName')->index();
22+
$table->string('displayName')->index();
23+
$table->string('location');
24+
$table->string('url');
25+
$table->integer('status_id')->index()->default(1);
26+
$table->string('email')->index();
27+
$table->timestamp('lastActive')->nullable();
28+
$table->string('gravatarEmail')->nullable();
29+
$table->string('githubToken', 40)->nullable();
30+
$table->string('githubLogin')->nullable();
31+
$table->timestamps();
32+
$table->softDeletes();
33+
});
34+
}
35+
36+
/**
37+
* Reverse the migrations.
38+
*
39+
* @return void
40+
*/
41+
public function down()
42+
{
43+
Schema::drop('users');
44+
}
45+
46+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
5+
class CreateSessionTable extends Migration {
6+
7+
/**
8+
* Run the migrations.
9+
*
10+
* @return void
11+
*/
12+
public function up()
13+
{
14+
Schema::create('sessions', function($t)
15+
{
16+
$t->string('id')->unique();
17+
$t->text('payload');
18+
$t->integer('last_activity');
19+
});
20+
}
21+
22+
/**
23+
* Reverse the migrations.
24+
*
25+
* @return void
26+
*/
27+
public function down()
28+
{
29+
Schema::drop('sessions');
30+
}
31+
32+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
6+
class CreateRolesTable extends Migration {
7+
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::create('roles', function(Blueprint $table) {
16+
$table->increments('id');
17+
$table->string('group')->index();
18+
$table->string('name')->index();
19+
$table->string('keyName')->index();
20+
$table->string('description');
21+
$table->integer('priority');
22+
$table->timestamps();
23+
});
24+
}
25+
26+
/**
27+
* Reverse the migrations.
28+
*
29+
* @return void
30+
*/
31+
public function down()
32+
{
33+
Schema::drop('roles');
34+
}
35+
36+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
6+
class CreateActionsTable extends Migration {
7+
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::create('actions', function(Blueprint $table) {
16+
$table->increments('id');
17+
$table->string('name')->index();
18+
$table->string('description');
19+
$table->string('keyName')->index();
20+
$table->timestamps();
21+
});
22+
}
23+
24+
/**
25+
* Reverse the migrations.
26+
*
27+
* @return void
28+
*/
29+
public function down()
30+
{
31+
Schema::drop('actions');
32+
}
33+
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
6+
class CreateActionRolesTable extends Migration {
7+
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::create('action_roles', function(Blueprint $table) {
16+
$table->increments('id');
17+
$table->integer('action_id')->index();
18+
$table->integer('role_id')->index();
19+
$table->timestamps();
20+
$table->unique(array('action_id', 'role_id'));
21+
});
22+
}
23+
24+
/**
25+
* Reverse the migrations.
26+
*
27+
* @return void
28+
*/
29+
public function down()
30+
{
31+
Schema::drop('action_roles');
32+
}
33+
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
6+
class CreateRoleUsersTable extends Migration {
7+
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::create('role_users', function(Blueprint $table) {
16+
$table->increments('id');
17+
$table->integer('role_id')->index();
18+
$table->string('user_id', 10)->index();
19+
$table->timestamps();
20+
$table->unique(array('role_id', 'user_id'));
21+
});
22+
}
23+
24+
/**
25+
* Reverse the migrations.
26+
*
27+
* @return void
28+
*/
29+
public function down()
30+
{
31+
Schema::drop('role_users');
32+
}
33+
34+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
6+
class CreatePreferencesTable extends Migration {
7+
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::create('preferences', function(Blueprint $table) {
16+
$table->increments('id');
17+
$table->string('name');
18+
$table->string('keyName');
19+
$table->string('description');
20+
$table->text('value');
21+
$table->string('default');
22+
$table->string('display');
23+
$table->timestamps();
24+
});
25+
}
26+
27+
/**
28+
* Reverse the migrations.
29+
*
30+
* @return void
31+
*/
32+
public function down()
33+
{
34+
Schema::drop('preferences');
35+
}
36+
37+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
6+
class CreatePreferencesUsersTable extends Migration {
7+
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::create('preferences_users', function(Blueprint $table) {
16+
$table->increments('id');
17+
$table->string('user_id', 10)->index();
18+
$table->integer('preference_id')->index();
19+
$table->string('value');
20+
$table->timestamps();
21+
});
22+
}
23+
24+
/**
25+
* Reverse the migrations.
26+
*
27+
* @return void
28+
*/
29+
public function down()
30+
{
31+
Schema::drop('preferences_users');
32+
}
33+
34+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
6+
class CreateMessagesTable extends Migration {
7+
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::create('messages', function(Blueprint $table) {
16+
$table->string('uniqueId', 10);
17+
$table->primary('uniqueId');
18+
$table->integer('message_type_id')->index();
19+
$table->string('sender_id', 10)->index();
20+
$table->string('receiver_id', 10)->index();
21+
$table->string('parent_id', 10)->index()->nullable();
22+
$table->string('child_id', 10)->index()->nullable();
23+
$table->string('title');
24+
$table->text('content');
25+
$table->timestamps();
26+
$table->softDeletes();
27+
});
28+
}
29+
30+
/**
31+
* Reverse the migrations.
32+
*
33+
* @return void
34+
*/
35+
public function down()
36+
{
37+
Schema::drop('messages');
38+
}
39+
40+
}

0 commit comments

Comments
 (0)