diff options
Diffstat (limited to 'backyard/php-api/trunk/database')
6 files changed, 90 insertions, 0 deletions
diff --git a/backyard/php-api/trunk/database/.gitignore b/backyard/php-api/trunk/database/.gitignore new file mode 100644 index 0000000..9b1dffd --- /dev/null +++ b/backyard/php-api/trunk/database/.gitignore @@ -0,0 +1 @@ +*.sqlite diff --git a/backyard/php-api/trunk/database/migrations/.gitkeep b/backyard/php-api/trunk/database/migrations/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/backyard/php-api/trunk/database/migrations/.gitkeep diff --git a/backyard/php-api/trunk/database/migrations/2014_10_12_000000_create_users_table.php b/backyard/php-api/trunk/database/migrations/2014_10_12_000000_create_users_table.php new file mode 100644 index 0000000..36a1db9 --- /dev/null +++ b/backyard/php-api/trunk/database/migrations/2014_10_12_000000_create_users_table.php @@ -0,0 +1,36 @@ +<?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('name'); + $table->string('email')->unique(); + $table->string('password', 60); + $table->rememberToken(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('users'); + } + +} diff --git a/backyard/php-api/trunk/database/migrations/2014_10_12_100000_create_password_resets_table.php b/backyard/php-api/trunk/database/migrations/2014_10_12_100000_create_password_resets_table.php new file mode 100644 index 0000000..679df38 --- /dev/null +++ b/backyard/php-api/trunk/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -0,0 +1,33 @@ +<?php + +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Migrations\Migration; + +class CreatePasswordResetsTable extends Migration { + + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('password_resets', function(Blueprint $table) + { + $table->string('email')->index(); + $table->string('token')->index(); + $table->timestamp('created_at'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('password_resets'); + } + +} diff --git a/backyard/php-api/trunk/database/seeds/.gitkeep b/backyard/php-api/trunk/database/seeds/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/backyard/php-api/trunk/database/seeds/.gitkeep diff --git a/backyard/php-api/trunk/database/seeds/DatabaseSeeder.php b/backyard/php-api/trunk/database/seeds/DatabaseSeeder.php new file mode 100644 index 0000000..b3c69b5 --- /dev/null +++ b/backyard/php-api/trunk/database/seeds/DatabaseSeeder.php @@ -0,0 +1,20 @@ +<?php + +use Illuminate\Database\Seeder; +use Illuminate\Database\Eloquent\Model; + +class DatabaseSeeder extends Seeder { + + /** + * Run the database seeds. + * + * @return void + */ + public function run() + { + Model::unguard(); + + // $this->call('UserTableSeeder'); + } + +} |