[WIP] Setup of skeleton

This commit is contained in:
Ludovic CANDELLIER
2020-03-25 00:08:27 +01:00
parent baf8e13c25
commit 36267139a1
377 changed files with 18248 additions and 26 deletions

View File

@@ -0,0 +1,25 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTaggedTable extends Migration {
public function up() {
Schema::create('tagging_tagged', function(Blueprint $table) {
$table->increments('id');
if(config('tagging.primary_keys_type') == 'string') {
$table->string('taggable_id', 36)->index();
} else {
$table->integer('taggable_id')->unsigned()->index();
}
$table->string('taggable_type', 125)->index();
$table->string('tag_name', 125);
$table->string('tag_slug', 125)->index();
});
}
public function down() {
Schema::drop('tagging_tagged');
}
}

View File

@@ -0,0 +1,24 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTagsTable extends Migration
{
public function up()
{
Schema::create('tagging_tags', function(Blueprint $table) {
$table->increments('id');
$table->string('slug', 125)->index();
$table->string('name', 125);
$table->boolean('suggest')->default(false);
$table->integer('count')->unsigned()->default(0); // count of how many times this tag was used
$table->integer('tag_group_id')->unsigned()->nullable();
});
}
public function down()
{
Schema::drop('tagging_tags');
}
}

View File

@@ -0,0 +1,21 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateTagGroupsTable extends Migration {
public function up()
{
Schema::create('tagging_tag_groups', function(Blueprint $table) {
$table->increments('id');
$table->string('slug', 125)->index();
$table->string('name', 125);
});
}
public function down()
{
Schema::drop('tagging_tag_groups');
}
}

View File

@@ -0,0 +1,24 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class UpdateTagsTable extends Migration {
public function up()
{
Schema::table('tagging_tags', function ($table) {
$table->foreign('tag_group_id')->references('id')->on('tagging_tag_groups');
});
}
public function down()
{
Schema::disableForeignKeyConstraints();
Schema::table('tagging_tags', function ($table) {
$table->dropForeign('tagging_tags_tag_group_id_foreign');
});
}
}

View File

@@ -0,0 +1,50 @@
<?php
/**
* This file is part of Jrean\UserVerification package.
*
* (c) Jean Ragouin <go@askjong.com> <www.askjong.com>
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddVerificationToUserTable extends Migration
{
/**
* Determine the user table name.
*
* @return string
*/
public function getUserTableName()
{
$user_model = config('auth.providers.users.model', App\User::class);
return (new $user_model)->getTable();
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table($this->getUserTableName(), function (Blueprint $table) {
$table->boolean('verified')->default(false);
$table->string('verification_token')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table($this->getUserTableName(), function (Blueprint $table) {
$table->dropColumn('verified');
$table->dropColumn('verification_token');
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAuthenticationLogTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('authentication_log', function (Blueprint $table) {
$table->bigIncrements('id');
$table->morphs('authenticatable');
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->timestamp('login_at')->nullable();
$table->timestamp('logout_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('authentication_log');
}
}

View File

@@ -0,0 +1,43 @@
<?php
/**
* Laravel Schematics
*
* WARNING: removing @tag value will disable automated removal
*
* @package Laravel-schematics
* @author Maarten Tolhuijs <mtolhuys@protonmail.com>
* @url https://github.com/mtolhuys/laravel-schematics
* @tag laravel-schematics-products-model
*/
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', static function (Blueprint $table) {
$table->increments('id');
$table->string('title', 255)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('products');
}
}

View File

@@ -0,0 +1,42 @@
<?php
/**
* Laravel Schematics
*
* WARNING: removing @tag value will disable automated removal
*
* @package Laravel-schematics
* @author Maarten Tolhuijs <mtolhuys@protonmail.com>
* @url https://github.com/mtolhuys/laravel-schematics
* @tag laravel-schematics-customers-model
*/
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCustomersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('customers', static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('customers');
}
}

View File

@@ -0,0 +1,47 @@
<?php
/**
* Laravel Schematics
*
* WARNING: removing @tag value will disable automated removal
*
* @package Laravel-schematics
* @author Maarten Tolhuijs <mtolhuys@protonmail.com>
* @url https://github.com/mtolhuys/laravel-schematics
* @tag laravel-schematics-invoices-model
*/
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateInvoicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('invoices', static function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->boolean('status_id', true);
$table->decimal('subtotal', 10, 2);
$table->decimal('total', 10, 2);
$table->decimal('shipping', 10, 2);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('invoices');
}
}

View File

@@ -0,0 +1,53 @@
<?php
/**
* Laravel Schematics
*
* WARNING: removing @tag value will disable automated removal
*
* @package Laravel-schematics
* @author Maarten Tolhuijs <mtolhuys@protonmail.com>
* @url https://github.com/mtolhuys/laravel-schematics
* @tag laravel-schematics-invoice_items-model
*/
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateInvoiceItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('invoice_items', static function (Blueprint $table) {
$table->increments('id');
$table->integer('invoice_id')->nullable();
$table->integer('product_id')->nullable();
$table->integer('status')->nullable();
$table->integer('quantity')->nullable();
$table->decimal('unit_price',10,2);
$table->integer('tax_id')->nullable();
$table->integer('raw_price')->nullable();
$table->integer('tax')->nullable();
$table->integer('total_price')->nullable();
$table->decimal('discount_percent')->nullable();
$table->decimal('discount')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('invoice_items');
}
}

View File

@@ -0,0 +1,42 @@
<?php
/**
* Laravel Schematics
*
* WARNING: removing @tag value will disable automated removal
*
* @package Laravel-schematics
* @author Maarten Tolhuijs <mtolhuys@protonmail.com>
* @url https://github.com/mtolhuys/laravel-schematics
* @tag laravel-schematics-orders-model
*/
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateOrdersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('orders', static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('orders');
}
}

View File

@@ -0,0 +1,43 @@
<?php
/**
* Laravel Schematics
*
* WARNING: removing @tag value will disable automated removal
*
* @package Laravel-schematics
* @author Maarten Tolhuijs <mtolhuys@protonmail.com>
* @url https://github.com/mtolhuys/laravel-schematics
* @tag laravel-schematics-order_payments-model
*/
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateOrderPaymentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('order_payments', static function (Blueprint $table) {
$table->increments('id');
$table->integer('order_id')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('order_payments');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMediaTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create('media', function (Blueprint $table) {
$table->bigIncrements('id');
$table->morphs('model');
$table->string('collection_name');
$table->string('name');
$table->string('file_name');
$table->string('mime_type')->nullable();
$table->string('disk');
$table->unsignedBigInteger('size');
$table->json('manipulations');
$table->json('custom_properties');
$table->json('responsive_images');
$table->unsignedInteger('order_column')->nullable();
$table->nullableTimestamps();
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::dropIfExists('media');
}
}

View File

@@ -0,0 +1,87 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class TeamworkSetupTables extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table( \Config::get( 'teamwork.users_table' ), function ( Blueprint $table )
{
$table->integer( 'current_team_id' )->unsigned()->nullable();
} );
Schema::create( \Config::get( 'teamwork.teams_table' ), function ( Blueprint $table )
{
$table->increments( 'id' )->unsigned();
$table->integer( 'owner_id' )->unsigned()->nullable();
$table->string( 'name' );
$table->timestamps();
} );
Schema::create( \Config::get( 'teamwork.team_user_table' ), function ( Blueprint $table )
{
$table->bigInteger( 'user_id' )->unsigned();
$table->integer( 'team_id' )->unsigned();
$table->timestamps();
$table->foreign( 'user_id' )
->references( \Config::get( 'teamwork.user_foreign_key' ) )
->on( \Config::get( 'teamwork.users_table' ) )
->onUpdate( 'cascade' )
->onDelete( 'cascade' );
$table->foreign( 'team_id' )
->references( 'id' )
->on( \Config::get( 'teamwork.teams_table' ) )
->onDelete( 'cascade' );
} );
Schema::create( \Config::get( 'teamwork.team_invites_table' ), function(Blueprint $table)
{
$table->increments('id');
$table->bigInteger('user_id')->unsigned();
$table->integer('team_id')->unsigned();
$table->enum('type', ['invite', 'request']);
$table->string('email');
$table->string('accept_token');
$table->string('deny_token');
$table->timestamps();
$table->foreign( 'team_id' )
->references( 'id' )
->on( \Config::get( 'teamwork.teams_table' ) )
->onDelete( 'cascade' );
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table(\Config::get( 'teamwork.users_table' ), function(Blueprint $table)
{
$table->dropColumn('current_team_id');
});
Schema::table(\Config::get('teamwork.team_user_table'), function (Blueprint $table) {
$table->dropForeign(\Config::get('teamwork.team_user_table').'_user_id_foreign');
$table->dropForeign(\Config::get('teamwork.team_user_table').'_team_id_foreign');
});
Schema::drop(\Config::get('teamwork.team_user_table'));
Schema::drop(\Config::get('teamwork.team_invites_table'));
Schema::drop(\Config::get('teamwork.teams_table'));
}
}