Skip to content

Commit

Permalink
Remove addresses table, keep everything in orders
Browse files Browse the repository at this point in the history
After spending all that time sorting the addresses stuff, I
noticed there'd be an issue creating the orders. Rather than
faff about making the database happy with no address relations,
we'll just ditch them. No reason they can't live with orders anyway.
  • Loading branch information
dshoreman committed Oct 11, 2014
1 parent 2a66104 commit fd211e7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 125 deletions.
39 changes: 0 additions & 39 deletions models/Address.php

This file was deleted.

29 changes: 0 additions & 29 deletions models/address/columns.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions models/address/fields.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions updates/create_addresses_table.php

This file was deleted.

17 changes: 11 additions & 6 deletions updates/create_orders_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
}

Expand Down
1 change: 0 additions & 1 deletion updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fd211e7

Please sign in to comment.