Created
March 11, 2017 16:42
-
-
Save maxheckel/a91866080d4182e37dc2025ade59fa27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| Schema::create('users', function (Blueprint $table) { | |
| $table->increments('id'); | |
| $table->string('name'); | |
| $table->string('email')->unique(); | |
| $table->string('password'); | |
| $table->rememberToken(); | |
| $table->timestamps(); | |
| }); | |
| Schema::create('cart_item', function (Blueprint $table) { | |
| $table->increments('id'); | |
| $table->timestamps(); | |
| $table->integer('cart_id'); | |
| $table->integer('product_id'); | |
| $table->integer('quantity'); | |
| }); | |
| Schema::create('products', function (Blueprint $table) { | |
| $table->increments('id'); | |
| $table->timestamps(); | |
| $table->string('title'); | |
| $table->text('description'); | |
| $table->float('price'); | |
| /** Whether or not the product can be purchased currently */ | |
| $table->boolean('available')->default(true); | |
| }); | |
| Schema::create('carts', function (Blueprint $table) { | |
| $table->increments('id'); | |
| $table->timestamps(); | |
| $table->integer('user_id'); | |
| $table->boolean('purchased')->default(false); | |
| $table->timestamp('sales_date')->nullable(); | |
| $table->float('sales_price')->nullable(); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment