Browse Source
Added table all migrations files
Added table all migrations files
Fixed role and permission table seeder Fixed missing DatabaseMigrations usage on api manage project testpull/1/head
16 changed files with 379 additions and 97 deletions
-
192composer.lock
-
5database/migrations/2014_10_12_000000_create_users_table.php
-
3database/migrations/2014_10_12_100000_create_password_resets_table.php
-
3database/migrations/2015_07_14_131409_create_site_options_table.php
-
5database/migrations/2015_08_12_205415_create_roles_permissions_table.php
-
3database/migrations/2016_03_04_020423_create_user_role_permission_table.php
-
3database/migrations/2016_03_04_030804_create_site_references_table.php
-
3database/migrations/2016_03_05_083739_create_role_user_table.php
-
43database/migrations/2016_07_06_110052_create_projects_table.php
-
46database/migrations/2016_07_08_182606_create_subscriptions_table.php
-
40database/migrations/2016_07_09_093439_create_features_table.php
-
39database/migrations/2016_07_09_142833_create_tasks_table.php
-
41database/migrations/2016_11_15_151228_create_payments_table.php
-
40database/migrations/2016_11_25_145359_create_user_events_table.php
-
8database/seeds/UserRolesPermissionsTableSeeder.php
-
2tests/api/ApiManageProjectsTest.php
@ -0,0 +1,43 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Database\Migrations\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
|
|||
class CreateProjectsTable extends Migration { |
|||
|
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('projects', function(Blueprint $table) |
|||
{ |
|||
$table->increments('id'); |
|||
$table->string('name', 60); |
|||
$table->string('description')->nullable(); |
|||
$table->date('proposal_date')->nullable(); |
|||
$table->date('start_date')->nullable(); |
|||
$table->date('end_date')->nullable(); |
|||
$table->integer('project_value')->unsigned(); |
|||
$table->integer('proposal_value')->unsigned()->nullable(); |
|||
$table->boolean('status_id')->default(1)->comment('1: planned, 2: on progress, 3: done, 4: closed, 5: canceled, 6: on hold '); |
|||
$table->integer('customer_id')->unsigned(); |
|||
$table->integer('owner_id')->unsigned(); |
|||
$table->timestamps(); |
|||
}); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::drop('projects'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,46 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Database\Migrations\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
|
|||
class CreateSubscriptionsTable extends Migration { |
|||
|
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('subscriptions', function(Blueprint $table) |
|||
{ |
|||
$table->increments('id'); |
|||
$table->integer('project_id')->unsigned(); |
|||
$table->integer('customer_id')->unsigned(); |
|||
$table->integer('vendor_id')->unsigned(); |
|||
$table->string('domain_name', 60); |
|||
$table->string('epp_code', 60)->nullable(); |
|||
$table->integer('domain_price')->unsigned(); |
|||
$table->string('hosting_capacity', 60)->nullable(); |
|||
$table->boolean('status_id')->default(1); |
|||
$table->integer('hosting_price')->unsigned()->nullable(); |
|||
$table->date('start_date')->nullable(); |
|||
$table->date('due_date')->nullable(); |
|||
$table->string('remark')->nullable(); |
|||
$table->timestamps(); |
|||
$table->unique(['domain_name','epp_code'], 'domain_name_epp_code'); |
|||
}); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::drop('subscriptions'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Database\Migrations\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
|
|||
class CreateFeaturesTable extends Migration { |
|||
|
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('features', function(Blueprint $table) |
|||
{ |
|||
$table->increments('id'); |
|||
$table->integer('project_id')->unsigned(); |
|||
$table->string('name', 60); |
|||
$table->string('description')->nullable(); |
|||
$table->integer('worker_id')->unsigned()->nullable(); |
|||
$table->integer('price')->unsigned()->default(0); |
|||
$table->boolean('type_id')->default(1)->comment('1: main, 2: additional'); |
|||
$table->boolean('position')->default(0); |
|||
$table->timestamps(); |
|||
}); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::drop('features'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Database\Migrations\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
|
|||
class CreateTasksTable extends Migration { |
|||
|
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('tasks', function(Blueprint $table) |
|||
{ |
|||
$table->increments('id'); |
|||
$table->integer('feature_id')->unsigned(); |
|||
$table->string('name', 60); |
|||
$table->string('description')->nullable(); |
|||
$table->boolean('progress')->default(0); |
|||
$table->string('route_name')->nullable(); |
|||
$table->boolean('position')->default(0); |
|||
$table->timestamps(); |
|||
}); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::drop('tasks'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Database\Migrations\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
|
|||
class CreatePaymentsTable extends Migration { |
|||
|
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('payments', function(Blueprint $table) |
|||
{ |
|||
$table->increments('id'); |
|||
$table->integer('project_id')->unsigned(); |
|||
$table->integer('amount')->unsigned(); |
|||
$table->boolean('type_id')->default(1)->comment('1:project, 2: add_feature, 3:maintenance'); |
|||
$table->boolean('in_out')->default(1)->comment('0: out, 1: in'); |
|||
$table->date('date'); |
|||
$table->string('description'); |
|||
$table->integer('customer_id')->unsigned(); |
|||
$table->integer('owner_id')->unsigned(); |
|||
$table->timestamps(); |
|||
}); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::drop('payments'); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
<?php |
|||
|
|||
use Illuminate\Database\Migrations\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
|
|||
class CreateUserEventsTable extends Migration { |
|||
|
|||
/** |
|||
* Run the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function up() |
|||
{ |
|||
Schema::create('user_events', function(Blueprint $table) |
|||
{ |
|||
$table->increments('id'); |
|||
$table->integer('user_id')->unsigned(); |
|||
$table->integer('project_id')->unsigned()->nullable(); |
|||
$table->string('title', 60); |
|||
$table->string('body')->nullable(); |
|||
$table->dateTime('start')->nullable(); |
|||
$table->dateTime('end')->nullable(); |
|||
$table->boolean('is_allday')->default(0); |
|||
$table->timestamps(); |
|||
}); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Reverse the migrations. |
|||
* |
|||
* @return void |
|||
*/ |
|||
public function down() |
|||
{ |
|||
Schema::drop('user_events'); |
|||
} |
|||
|
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue