first commit

This commit is contained in:
Kevin Adametz 2021-01-08 17:48:20 +01:00
commit 0baac018a2
1011 changed files with 145854 additions and 0 deletions

2
database/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.sqlite
*.sqlite-journal

View file

@ -0,0 +1,27 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
});

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
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');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}

View file

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('failed_jobs');
}
}

View file

@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUserUpdateEmailsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_update_emails', function (Blueprint $table) {
$table->unsignedInteger('user_id');
$table->string('email')->unique();
$table->string('token')->index();
$table->timestamp('created_at');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_update_emails');
}
}

View file

@ -0,0 +1,54 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCountriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('countries', function (Blueprint $table) {
$table->increments('id');
$table->char('code', 2)->index();
$table->string('phone', 6)->nullable();
$table->string('en', 100)->index();
$table->string('de', 100)->index();
$table->string('es', 100);
$table->string('fr', 100);
$table->string('it', 100);
$table->string('ru', 100);
$table->boolean('switch')->default(false);
$table->boolean('own_eur')->default(false);
$table->boolean('currency')->default(false);
$table->string('currency_unit', 10)->nullable();
$table->boolean('currency_calc')->default(false);
$table->decimal('currency_faktor', 4, 2)->nullable();
$table->boolean('active')->default(true);
$table->text('trans_name')->nullable();
$table->text('attr')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('countries');
}
}

View file

@ -0,0 +1,98 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUserAccountsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_accounts', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('m_account')->unique()->nullable();
$table->char('m_salutation', 2)->nullable();
$table->string('m_first_name')->nullable();
$table->string('m_last_name')->nullable();
$table->text('m_notes')->nullable();
$table->string('company')->nullable();
$table->char('salutation', 2)->nullable();
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->string('address')->nullable();
$table->string('address_2')->nullable();
$table->string('zipcode', 10)->nullable();
$table->string('city')->nullable();
$table->unsignedInteger('country_id')->index()->default(1);
$table->unsignedInteger('pre_phone_id')->nullable();
$table->string('phone')->nullable();
$table->unsignedInteger('pre_mobil_id')->nullable();
$table->string('mobil')->nullable();
$table->string('tax_number', 20)->nullable();
$table->string('tax_identification_number', 20)->nullable();
$table->unsignedTinyInteger('taxable_sales')->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')->default(1);
$table->unsignedInteger('shipping_pre_phone_id')->nullable();
$table->string('shipping_phone')->nullable();
$table->date('birthday')->nullable();
$table->string('website')->nullable();
$table->string('facebook')->nullable();
$table->string('facebook_fanpage')->nullable();
$table->string('instagram')->nullable();
$table->text('payment_data')->nullable();
$table->timestamp('data_protection')->nullable();
$table->timestamp('accepted_contract')->nullable();
$table->text('notice')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreign('country_id')
->references('id')
->on('countries');
$table->foreign('shipping_country_id')
->references('id')
->on('countries');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_accounts');
}
}

View file

@ -0,0 +1,43 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUserLevelsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_levels', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->index();
$table->text('trans_name')->nullable();
$table->text('content')->nullable();
$table->text('trans_content')->nullable();
$table->tinyInteger('pos')->unsigned()->nullable();
$table->boolean('active')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_levels');
}
}

View file

@ -0,0 +1,42 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateIqImagesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('iq_images', function (Blueprint $table) {
$table->increments('id');
$table->string('filename')->index();
$table->string('original_name')->index();
$table->string('ext')->index();
$table->string('mine')->index();
$table->unsignedInteger('size');
$table->boolean('active')->default(true);
$table->string('slug')->unique()->index();
$table->unsignedTinyInteger('pos')->nullable()->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('iq_images');
}
}

View file

@ -0,0 +1,45 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAttributesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('attributes', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('parent_id')->index()->nullable();
$table->string('name')->index();
$table->text('trans_name')->nullable();
$table->tinyInteger('pos')->unsigned()->nullable();
$table->boolean('active')->default(false);
$table->string('slug')->unique()->index();
$table->timestamps();
$table->foreign('parent_id')
->references('id')
->on('attributes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('attributes');
}
}

View file

@ -0,0 +1,54 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categories', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('parent_id')->index()->nullable();
$table->string('name')->index();
$table->string('headline')->index();
$table->unsignedInteger('headline_image_id')->nullable()->index();
$table->text('trans_headline')->nullable();
$table->text('trans_name')->nullable();
$table->unsignedTinyInteger('pos')->nullable()->default(0);
$table->boolean('active')->default(false);
$table->string('slug')->unique()->index();
$table->timestamps();
$table->foreign('parent_id')
->references('id')
->on('categories');
$table->foreign('headline_image_id')
->references('id')
->on('iq_images');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('categories');
}
}

View file

@ -0,0 +1,90 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('products', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->index();
$table->text('trans_name')->nullable();
$table->string('title')->nullable()->index();
$table->text('trans_title')->nullable();
$table->text('copy')->nullable();
$table->mediumText('trans_copy')->nullable();
$table->decimal('price', 8, 2)->nullable();
$table->decimal('price_ek', 8, 2)->nullable();
$table->decimal('tax', 5, 2)->nullable();
$table->decimal('price_old', 8, 2)->nullable(); //streichpreis
$table->unsignedInteger('points')->nullable()->default(0);
$table->unsignedInteger('weight')->nullable()->default(0);
$table->string('contents')->nullable();
$table->unsignedInteger('contents_total')->nullable();
$table->unsignedTinyInteger('unit')->nullable();
$table->string('number')->nullable();
$table->unsignedInteger('wp_number')->nullable();
$table->string('icons')->nullable(); //as array cast
$table->text('description')->nullable();
$table->mediumText('trans_description')->nullable();
$table->text('usage')->nullable();
$table->mediumText('trans_usage')->nullable();
$table->text('ingredients')->nullable();
$table->mediumText('trans_ingredients')->nullable();
$table->tinyInteger('pos')->unsigned()->nullable();
$table->boolean('active')->default(false);
$table->unsignedInteger('amount')->nullable(); //for shop
$table->string('slug')->index();
$table->tinyInteger('show_at')->unsigned()->nullable()->default(0);
$table->boolean('shipping_addon')->default(false);
$table->string('identifier', 20)->nullable();
$table->string('action')->nullable();
//is an upgrade product, set this product id by payments API paid
$table->unsignedInteger('upgrade_to_id')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('products');
}
}

View file

@ -0,0 +1,45 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductAttributesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('product_attributes', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('product_id')->index();
$table->unsignedInteger('attribute_id')->index();
$table->timestamps();
$table->foreign('product_id')
->references('id')
->on('products');
$table->foreign('attribute_id')
->references('id')
->on('attributes')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('product_attributes');
}
}

View file

@ -0,0 +1,45 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('product_categories', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('product_id')->index();
$table->unsignedInteger('category_id')->index();
$table->timestamps();
$table->foreign('product_id')
->references('id')
->on('products');
$table->foreign('category_id')
->references('id')
->on('categories')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('product_categories');
}
}

View file

@ -0,0 +1,49 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductImagesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('product_images', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('product_id')->nullable()->index();
$table->string('filename')->index();
$table->string('original_name')->index();
$table->string('ext')->index();
$table->string('mine')->index();
$table->unsignedInteger('size');
$table->boolean('active')->default(true);
$table->string('slug')->unique()->index();
$table->unsignedTinyInteger('pos')->nullable()->default(0);
$table->timestamps();
$table->foreign('product_id')
->references('id')
->on('products')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('product_images');
}
}

View file

@ -0,0 +1,30 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateShoppingcartTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create(config('cart.database.table'), function (Blueprint $table) {
$table->string('identifier');
$table->string('instance');
$table->longText('content');
$table->nullableTimestamps();
$table->primary(['identifier', 'instance']);
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::drop(config('cart.database.table'));
}
}

View file

@ -0,0 +1,39 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateShippingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shippings', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->index();
$table->text('trans_name')->nullable();
$table->decimal('free', 8, 2)->nullable();
$table->boolean('active')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('shippings');
}
}

View file

@ -0,0 +1,52 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateShippingPricesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shipping_prices', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('shipping_id');
$table->decimal('price', 8, 2)->nullable();
$table->decimal('price_comp', 8, 2)->nullable();
$table->unsignedTinyInteger('num_comp')->nullable();
$table->decimal('tax_rate', 5, 2)->nullable();
$table->decimal('factor', 5, 2)->nullable();
$table->decimal('total_from', 8, 2)->nullable();
$table->decimal('total_to', 8, 2)->nullable();
$table->unsignedInteger('weight_from')->nullable();
$table->unsignedInteger('weight_to')->nullable();
$table->timestamps();
$table->foreign('shipping_id')
->references('id')
->on('shippings')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('shipping_prices');
}
}

View file

@ -0,0 +1,44 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateShippingCountriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shipping_countries', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('shipping_id');
$table->unsignedInteger('country_id')->nullable()->index();
$table->timestamps();
$table->foreign('shipping_id')
->references('id')
->on('shippings')
->onDelete('cascade');
$table->foreign('country_id')
->references('id')
->on('countries');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('shipping_countries');
}
}

View file

@ -0,0 +1,88 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->unsignedInteger('account_id')->nullable();
$table->unsignedInteger('m_level')->nullable();
$table->unsignedInteger('m_sponsor')->nullable();
$table->unsignedTinyInteger('admin')->default(0);
$table->unsignedTinyInteger('wizard')->default(0);
$table->boolean('blocked')->default(false);
$table->boolean('confirmed')->default(false);
$table->string('confirmation_code', 30)->index()->nullable();
$table->timestamp('confirmation_date')->nullable();
$table->dateTime('confirmation_code_to')->nullable();
$table->unsignedTinyInteger('confirmation_code_remider')->default(0);
$table->boolean('active')->default(false);
$table->timestamp('active_date')->nullable();
$table->dateTime('agreement')->nullable();
$table->char('lang', 2)->nullable();
$table->text('notes')->nullable();
$table->timestamp('last_login')->nullable();
$table->timestamp('release_account')->nullable();
$table->timestamp('account_payment')->nullable();
$table->string('payment_methods')->nullable();
$table->unsignedInteger('next_m_level')->nullable();
$table->boolean('abo_options')->default(false);
$table->boolean('test_mode')->default(false);
$table->text('settings')->nullable();
$table->rememberToken();
$table->timestamps();
$table->softDeletes();
$table->foreign('account_id')
->references('id')
->on('user_accounts');
$table->foreign('m_level')
->references('id')
->on('user_levels');
$table->foreign('next_m_level')
->references('id')
->on('user_levels');
$table->foreign('m_sponsor')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}

View file

@ -0,0 +1,49 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateIqSitesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('iq_sites', function (Blueprint $table) {
$table->increments('id');
$table->string('slug')->unique()->index();
$table->string('headline')->nullable();
$table->text('copy')->nullable();
$table->string('products')->nullable();
$table->string('set_products')->nullable();
$table->unsignedInteger('iq_image_id')->nullable()->index();
$table->foreign('iq_image_id')
->references('id')
->on('iq_images');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('iq_sites');
}
}

View file

@ -0,0 +1,46 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('files', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id')->nullable()->index();
$table->string('identifier')->index();
$table->string('filename');
$table->string('dir');
$table->string('original_name');
$table->string('ext');
$table->string('mine');
$table->unsignedInteger('size');
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('files');
}
}

View file

@ -0,0 +1,59 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUserMessagesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_messages', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id');
$table->unsignedInteger('send_user_id');
$table->string('email', 255);
$table->string('subject', 255);
$table->text('message')->nullable();
$table->boolean('send')->default(false);
$table->boolean('fail')->default(false);
$table->text('error')->nullable();
$table->timestamp('sent_at')->nullable();
$table->timestamp('scheduled_at')->nullable();
$table->timestamp('delivered_at')->nullable();
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users')
->onDelete('cascade');
$table->foreign('send_user_id')
->references('id')
->on('users')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_messages');
}
}

View file

@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCountryPricesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('country_prices', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('country_id')->index();
$table->unsignedInteger('product_id')->index();
$table->decimal('c_price', 8, 2)->nullable();
$table->decimal('c_tax', 5, 2)->nullable();
$table->decimal('c_price_old', 8, 2)->nullable();
$table->decimal('c_currency', 8, 2)->nullable();
$table->timestamps();
$table->foreign('country_id')
->references('id')
->on('countries');
$table->foreign('product_id')
->references('id')
->on('products');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('country_prices');
}
}

View file

@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePaymentMethodsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('payment_methods', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->index();
$table->string('short', 10);
$table->unsignedTinyInteger('show_at')->nullable()->default(0);
$table->unsignedTinyInteger('pos')->nullable()->default(0);
$table->boolean('active')->default(false);
$table->boolean('default')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('payment_methods');
}
}

View file

@ -0,0 +1,51 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLoggersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('loggers', function (Blueprint $table) {
$table->increments('id');
//from user
$table->unsignedInteger('user_id')->nullable();
//to model
$table->unsignedInteger('model_id')->index()->nullable();
$table->string('model')->index()->nullable();
$table->string('action')->index()->nullable();
$table->string('channel')->index()->nullable();
$table->text('message')->nullable();
$table->unsignedTinyInteger('level')->index()->default(0);
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('loggers');
}
}

View file

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSySettingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sy_settings', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->index();
$table->string('slug')->unique()->index();
$table->text('message')->nullable();
$table->string('action')->index()->nullable();
$table->unsignedTinyInteger('status')->index()->default(0);
$table->boolean('active')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sy_settings');
}
}

View file

@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateIngredientsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ingredients', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->index();
$table->text('trans_name')->nullable();
$table->text('inci')->nullable();
$table->mediumText('trans_inci')->nullable();
$table->text('effect')->nullable();
$table->mediumText('trans_effect')->nullable();
$table->boolean('active')->default(false);
$table->unsignedTinyInteger('pos')->nullable()->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('ingredients');
}
}

View file

@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProductIngredientsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('product_ingredients', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('product_id')->index();
$table->unsignedInteger('ingredient_id')->index();
$table->timestamps();
$table->foreign('product_id')
->references('id')
->on('products');
$table->foreign('ingredient_id')
->references('id')
->on('ingredients')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('product_ingredients');
}
}

View file

@ -0,0 +1,105 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateShoppingUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shopping_users', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('auth_user_id');
$table->unsignedInteger('member_id')->nullable();
$table->unsignedInteger('number')->index()->nullable();
$table->boolean('is_like')->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('faker_mail')->default(false);
$table->string('shipping_email')->nullable();
$table->unsignedSmallInteger('orders')->nullable()->default(1);
$table->boolean('accepted_data_checkbox')->default(false);
$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->boolean('abo_options')->default(false);
$table->boolean('has_buyed')->default(false);
$table->boolean('subscribed')->default(false);
$table->text('notice')->nullable();
$table->char('mode', 4)->nullable();
$table->char('is_for', 2)->nullable();
$table->string('is_from', 10)->nullable();
$table->unsignedInteger('shopping_user_id')->index()->nullable();
$table->unsignedInteger('wp_order_number')->nullable();
$table->timestamp('wp_order_date')->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('member_id')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('shopping_users');
}
}

View file

@ -0,0 +1,82 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateShoppingOrdersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shopping_orders', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('shopping_user_id');
$table->unsignedInteger('auth_user_id');
$table->unsignedInteger('country_id');
$table->unsignedInteger('member_id')->nullable();
$table->unsignedTinyInteger('payment_for')->nullable();
$table->decimal('total', 13, 2)->nullable();
$table->decimal('subtotal', 13, 2)->nullable();
$table->decimal('shipping', 8, 2)->nullable();
$table->decimal('shipping_net', 8, 2)->nullable();
$table->decimal('subtotal_ws', 13, 2)->nullable();
$table->decimal('tax', 8, 2)->nullable();
$table->decimal('total_shipping', 13, 2)->nullable();
$table->unsignedInteger('points')->nullable();
$table->unsignedInteger('weight')->nullable();
$table->boolean('paid')->default(false);
$table->string('wp_invoice_path', 255)->nullable();
$table->text('wp_notice')->nullable();
$table->string('txaction', 20)->nullable()->index();
$table->unsignedTinyInteger('shipped')->default(0);
$table->string('tracking', 255)->nullable();
$table->char('mode', 4)->nullable();
$table->timestamps();
$table->softDeletes();
$table->timestamp('user_deleted_at')->nullable();
$table->foreign('shopping_user_id')
->references('id')
->on('shopping_users');
$table->foreign('country_id')
->references('id')
->on('shipping_countries');
$table->foreign('member_id')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('shopping_orders');
}
}

View file

@ -0,0 +1,57 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateShoppingOrderItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shopping_order_items', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('shopping_order_id');
$table->string('row_id', 40)->nullable();
$table->unsignedInteger('product_id');
$table->unsignedTinyInteger('comp')->nullable();
$table->unsignedInteger('qty');
$table->decimal('price', 8, 2)->nullable();
$table->decimal('price_net', 8, 3)->nullable();
$table->decimal('tax_rate', 5, 2)->nullable();
$table->string('slug')->nullable();
$table->timestamps();
$table->softDeletes();
$table->timestamp('user_deleted_at')->nullable();
$table->foreign('shopping_order_id')
->references('id')
->on('shopping_orders');
$table->foreign('product_id')
->references('id')
->on('products');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('shopping_order_items');
}
}

View file

@ -0,0 +1,52 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateShoppingPaymentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shopping_payments', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('shopping_order_id');
$table->string('clearingtype',3);
$table->string('wallettype', 3)->nullable();
$table->string('onlinebanktransfertype',3)->nullable();
$table->string('reference', 16);
$table->unsignedInteger('amount');
$table->string('currency', 6);
$table->string('status', 10)->nullable()->index();
$table->string('txaction', 20)->nullable()->index();
$table->char('mode', 4)->nullable();
$table->timestamps();
$table->foreign('shopping_order_id')
->references('id')
->on('shopping_orders');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('shopping_payments');
}
}

View file

@ -0,0 +1,56 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePaymentTransactionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('payment_transactions', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('shopping_payment_id');
$table->string('request',20);
$table->unsignedInteger('txid');
$table->unsignedInteger('userid');
$table->string('status',20)->nullable();
$table->string('key',40)->nullable();
$table->string('txaction',20)->nullable();
$table->text('transmitted_data')->nullable();
$table->unsignedInteger('errorcode')->nullable();
$table->string('errormessage')->nullable();
$table->string('customermessage')->nullable();
$table->char('mode', 4)->nullable();
$table->timestamps();
$table->foreign('shopping_payment_id')
->references('id')
->on('shopping_payments');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('payment_transactions');
}
}

View file

@ -0,0 +1,59 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUserHistoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_histories', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id');
$table->unsignedInteger('shopping_order_id')->nullable();
$table->unsignedInteger('product_id')->nullable();
$table->string('action')->index()->nullable();
$table->unsignedInteger('referenz')->default(0);
$table->string('identifier')->index()->nullable();
$table->boolean('abo_options')->default(false);
$table->unsignedTinyInteger('status')->index()->default(0);
$table->timestamps();
$table->foreign('shopping_order_id')
->references('id')
->on('shopping_orders');
$table->foreign('product_id')
->references('id')
->on('products');
$table->foreign('user_id')
->references('id')
->on('users')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_histories');
}
}

View file

@ -0,0 +1,16 @@
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
// $this->call(UsersTableSeeder::class);
}
}