diff options
author | Chaoyi Zha <summermontreal@gmail.com> | 2015-11-04 04:59:39 +0300 |
---|---|---|
committer | Chaoyi Zha <summermontreal@gmail.com> | 2015-11-04 04:59:39 +0300 |
commit | fa93feeeecf1604b24eca09e3710f4f1ac7c5b3a (patch) | |
tree | 203968593dc07f66d57b3f48e519e781bf5155db /database | |
parent | 5810db8405649ab28b1ee3a0298efbbbbd01135e (diff) |
Correctly run migrations
Diffstat (limited to 'database')
4 files changed, 89 insertions, 37 deletions
diff --git a/database/migrations/2015_11_04_015813_create_link_table.php b/database/migrations/2015_11_04_015813_create_link_table.php new file mode 100644 index 0000000..93ed696 --- /dev/null +++ b/database/migrations/2015_11_04_015813_create_link_table.php @@ -0,0 +1,43 @@ +<?php + +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Migrations\Migration; + +class CreateLinkTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('links', function(Blueprint $table) + { + $table->increments('id'); + + $table->string('long_url'); + $table->string('ip'); + $table->string('creator'); + $table->string('clicks'); + $table->string('secret_key'); + $table->string('disabled_previous_link'); + + $table->boolean('is_custom'); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('links', function (Blueprint $table) { + // + }); + } +} diff --git a/database/migrations/2015_11_04_015823_create_users_table.php b/database/migrations/2015_11_04_015823_create_users_table.php new file mode 100644 index 0000000..d2fd430 --- /dev/null +++ b/database/migrations/2015_11_04_015823_create_users_table.php @@ -0,0 +1,46 @@ +<?php + +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Migrations\Migration; + +class CreateUsersTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('users', function(Blueprint $table) + { + $table->increments('id'); + + $table->string('username'); + $table->string('password'); + $table->string('email'); + + $table->string('recovery_key'); + $table->string('role'); + $table->string('active'); + + $table->string('api_key'); + $table->boolean('api_active'); + $table->string('api_quota'); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + // + }); + } +} diff --git a/database/migrations/november_3_2015_create_link_table.php b/database/migrations/november_3_2015_create_link_table.php deleted file mode 100644 index 0080f5a..0000000 --- a/database/migrations/november_3_2015_create_link_table.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - -Schema::create('links', function(Blueprint $table) -{ - $table->increments('id'); - - $table->string('long_url'); - $table->string('ip'); - $table->string('creator'); - $table->string('clicks'); - $table->string('secret_key'); - $table->string('disabled_previous_link'); - - $table->boolean('is_custom'); - - $table->timestamps(); -}); diff --git a/database/migrations/november_3_2015_create_user_table.php b/database/migrations/november_3_2015_create_user_table.php deleted file mode 100644 index 25dc6d5..0000000 --- a/database/migrations/november_3_2015_create_user_table.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -Schema::create('users', function(Blueprint $table) -{ - $table->increments('id'); - - $table->string('username'); - $table->string('password'); - $table->string('email'); - - $table->string('recovery_key'); - $table->string('role'); - $table->string('active'); - - $table->string('api_key'); - $table->boolean('api_active'); - $table->string('api_quota'); - - $table->timestamps(); -}); |