+ Homparty Part 1

This commit is contained in:
Kevin Adametz 2020-10-16 16:18:00 +02:00
parent 74923859d1
commit 9252094a04
43 changed files with 2385 additions and 66 deletions

View file

@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateHomepartiesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('homeparties', function (Blueprint $table) {
$table->increments('id');
$table->date('date');
$table->string('name')->nullable();
$table->string('place')->nullable();
$table->text('description')->nullable();
$table->unsignedTinyInteger('pos')->default(0);
$table->unsignedTinyInteger('completed')->default(0);
$table->unsignedTinyInteger('status')->default(0);
$table->boolean('order_to')->default(true);
$table->boolean('active')->default(false);
$table->boolean('default')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('homeparties');
}
}

View file

@ -0,0 +1,95 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateHomepartyUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('homeparty_users', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('homeparty_id');
$table->unsignedInteger('auth_user_id');
$table->boolean('is_host')->default(false);
$table->char('billing_salutation', 2)->nullable();
$table->string('billing_company')->nullable();
$table->string('billing_firstname')->nullable();
$table->string('billing_lastname')->nullable();
$table->string('billing_address')->nullable();
$table->string('billing_address_2')->nullable();
$table->string('billing_zipcode')->nullable();
$table->string('billing_city')->nullable();
$table->unsignedInteger('billing_country_id');
$table->string('billing_phone')->nullable();
$table->string('billing_email')->nullable();
$table->boolean('same_as_billing')->default(true);
$table->char('shipping_salutation', 2)->nullable();
$table->string('shipping_company')->nullable();
$table->string('shipping_firstname')->nullable();
$table->string('shipping_lastname')->nullable();
$table->string('shipping_address')->nullable();
$table->string('shipping_address_2')->nullable();
$table->string('shipping_zipcode')->nullable();
$table->string('shipping_city')->nullable();
$table->unsignedInteger('shipping_country_id');
$table->string('shipping_phone')->nullable();
$table->string('shipping_email')->nullable();
$table->boolean('has_buyed')->default(false);
$table->boolean('subscribed')->default(false);
$table->string('token')->nullable();
$table->boolean('token_active')->default(true);
$table->text('notice')->nullable();
$table->char('mode', 4)->nullable();
$table->timestamps();
$table->softDeletes();
$table->timestamp('user_deleted_at')->nullable();
$table->foreign('billing_country_id')
->references('id')
->on('countries');
$table->foreign('shipping_country_id')
->references('id')
->on('countries');
$table->foreign('auth_user_id')
->references('id')
->on('users');
$table->foreign('homeparty_id')
->references('id')
->on('homeparties')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('homeparty_users');
}
}