diff --git a/models/Address.php b/models/Address.php deleted file mode 100644 index 3780caf..0000000 --- a/models/Address.php +++ /dev/null @@ -1,39 +0,0 @@ -engine = 'InnoDB'; - $table->increments('id'); - $table->string('name'); - $table->string('street'); - $table->string('town'); - $table->string('county'); - $table->string('postcode'); - $table->string('country'); - $table->timestamps(); - }); - } - - public function down() - { - Schema::dropIfExists('dshoreman_shop_addresses'); - } - -} diff --git a/updates/create_orders_table.php b/updates/create_orders_table.php index 2d2e01d..213b31d 100644 --- a/updates/create_orders_table.php +++ b/updates/create_orders_table.php @@ -13,16 +13,21 @@ public function up() $table->engine = 'InnoDB'; $table->increments('id'); $table->string('email'); - $table->string('stripe_token'); - $table->integer('billing_address')->unsigned(); - $table->integer('shipping_address')->unsigned(); $table->text('items'); $table->decimal('total', 7, 2); $table->boolean('is_paid')->default(false); + $table->string('stripe_token'); + $table->string('billing_name'); + $table->string('billing_street'); + $table->string('billing_town'); + $table->string('billing_county'); + $table->string('billing_postcode'); + $table->string('shipping_name'); + $table->string('shipping_street'); + $table->string('shipping_town'); + $table->string('shipping_county'); + $table->string('shipping_postcode'); $table->timestamps(); - - $table->foreign('billing_address')->references('id')->on('dshoreman_shop_addresses'); - $table->foreign('shipping_address')->references('id')->on('dshoreman_shop_addresses'); }); } diff --git a/updates/version.yaml b/updates/version.yaml index d931719..786a37a 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -2,6 +2,5 @@ - First version of Shop - create_categories_table.php - create_products_table.php - - create_addresses_table.php - create_orders_table.php - demo_seed.php