AionDatabase.io Progress

Greetings,

Currently, i set this forum in wait of the finished work of the database as we still hardcoding this new project

So you can also use the Pastebin here to get your code set in the propers format

just like so : https://aiondatabase.io/bin/qV

below is an example of the new generated code that I will use for create database of this new AionDatabase system

<?php

use Illuminate\Support\Fluent;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Grammars\MySqlGrammar;

/**
 * Extended version of MySqlGrammar with
 * support of 'set' data type
 */
class ExtendedMySqlGrammar extends MySqlGrammar {

    /**
     * Create the column definition for an 'set' type.
     *
     * @param  \Illuminate\Support\Fluent $column
     * @return string
     */
    protected function typeSet(Fluent $column)
    {
        return "set('" . implode ("', '", $column->allowed) . "')";
    }

}

/**
 * Extended version of Blueprint with
 * support of 'set' data type
 */
class ExtendedBlueprint extends Blueprint {

    /**
     * Create a new 'set' column on the table.
     *
     * @param  string $column
     * @param  array $allowed
     * @return \Illuminate\Support\Fluent
     */
    public function set($column, array $allowed)
    {
        return $this->addColumn ('set', $column, compact ('allowed'));
    }

}

class CreateClientItemsTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        // register new grammar class
        DB::connection ()->setSchemaGrammar (new ExtendedMySqlGrammar());
        $schema = DB::connection ()->getSchemaBuilder ();

        // replace blueprint
        $schema->blueprintResolver (function ($table, $callback)
        {
            return new ExtendedBlueprint($table, $callback);
        });

        //Schema::create ('client_items', function (Blueprint $table)
        $schema->create('client_items', function(ExtendedBlueprint $table)
        {
            $table->integer ('id')->unsigned ()->primary ();
            $table->boolean ('lore')->nullable ();
            $table->boolean ('can_exchange')->nullable ();
            $table->boolean ('can_sell_to_npc')->nullable ();
            $table->boolean ('can_deposit_to_character_warehouse')->nullable ();
            $table->boolean ('can_deposit_to_account_warehouse')->nullable ();
            $table->boolean ('can_deposit_to_guild_warehouse')->nullable ();
            $table->boolean ('breakable')->nullable ();
            $table->boolean ('soul_bind')->nullable ();
            $table->boolean ('remove_when_logout')->nullable ();
            $table->boolean ('can_exchange_only_guildmember')->nullable ();
            $table->boolean ('no_enchant')->nullable ();
            $table->boolean ('can_split')->nullable ();
            $table->boolean ('item_drop_permitted')->nullable ();
            $table->boolean ('can_ap_extraction')->nullable ();
            $table->boolean ('exceed_enchant')->nullable ();
            $table->boolean ('confirm_to_delete_cash_item')->nullable ();
            $table->boolean ('cannot_matter_option')->nullable ();
            $table->boolean ('cannot_extraction')->nullable ();
            $table->boolean ('can_proc_enchant')->nullable ();
            $table->boolean ('can_composite_weapon')->nullable ();
            $table->boolean ('can_polish')->nullable ();
            $table->boolean ('drop_each_member')->nullable ();
            $table->boolean ('default_prohibit')->nullable ();
            $table->boolean ('auto_use_on_mail_get_item')->nullable ();
            $table->integer ('price')->unsigned ()->nullable ();
            $table->integer ('max_stack_count')->unsigned ()->nullable ();
            $table->integer ('dodge')->unsigned ()->nullable ();
            $table->integer ('level')->unsigned ()->nullable ();
            $table->integer ('magical_resist')->unsigned ()->nullable ();
            $table->integer ('physical_defend')->unsigned ()->nullable ();
            $table->integer ('warrior')->unsigned ()->nullable ();
            $table->integer ('scout')->unsigned ()->nullable ();
            $table->integer ('mage')->unsigned ()->nullable ();
            $table->integer ('cleric')->unsigned ()->nullable ();
            $table->integer ('engineer')->unsigned ()->nullable ();
            $table->integer ('artist')->unsigned ()->nullable ();
            $table->integer ('fighter')->unsigned ()->nullable ();
            $table->integer ('knight')->unsigned ()->nullable ();
            $table->integer ('assassin')->unsigned ()->nullable ();
            $table->integer ('ranger')->unsigned ()->nullable ();
            $table->integer ('wizard')->unsigned ()->nullable ();
            $table->integer ('elementalist')->unsigned ()->nullable ();
            $table->integer ('chanter')->unsigned ()->nullable ();
            $table->integer ('priest')->unsigned ()->nullable ();
            $table->integer ('gunner')->unsigned ()->nullable ();
            $table->integer ('bard')->unsigned ()->nullable ();
            $table->integer ('rider')->unsigned ()->nullable ();
            $table->integer ('option_slot_value')->unsigned ()->nullable ();
            $table->integer ('special_slot_value')->unsigned ()->nullable ();
            $table->integer ('option_slot_bonus')->unsigned ()->nullable ();
            $table->integer ('max_enchant_value')->unsigned ()->nullable ();
            $table->boolean ('cannot_changeskin')->nullable ();
            $table->integer ('cash_item')->unsigned ()->nullable ();
            $table->boolean ('oversea_only')->nullable ();
            $table->boolean ('mesh_change')->nullable ();
            $table->boolean ('can_dye')->nullable ();
            $table->integer ('magical_defend')->unsigned ()->nullable ();
            $table->integer ('magical_skill_boost_resist')->unsigned ()->nullable ();
            $table->integer ('block')->unsigned ()->nullable ();
            $table->integer ('damage_reduce')->unsigned ()->nullable ();
            $table->integer ('reduce_max')->unsigned ()->nullable ();
            $table->integer ('max_hp')->unsigned ()->nullable ();
            $table->integer ('physical_critical_reduce_rate')->unsigned ()->nullable ();
            $table->integer ('parts_slot_value')->unsigned ()->nullable ();
            $table->integer ('parts_slot_bonus_value')->unsigned ()->nullable ();
            $table->integer ('max_enchant_bonus')->unsigned ()->nullable ();
            $table->integer ('extract_skin_type')->unsigned ()->nullable ();
            $table->integer ('bm_restrict_category')->unsigned ()->nullable ();
            $table->integer ('disposable_trade_item_count')->unsigned ()->nullable ();
            $table->integer ('expire_time')->unsigned ()->nullable ();
            $table->integer ('temporary_exchange_time')->unsigned ()->nullable ();
            $table->integer ('abyss_point')->unsigned ()->nullable ();
            $table->integer ('abyss_item_count')->unsigned ()->nullable ();
            $table->integer ('can_pack_count')->unsigned ()->nullable ();
            $table->integer ('extra_currency_item_count')->unsigned ()->nullable ();
            $table->integer ('guild_level_permitted')->unsigned ()->nullable ();
            $table->boolean ('use_emblem')->nullable ();
            $table->integer ('charge_way')->unsigned ()->nullable ();
            $table->integer ('charge_level')->unsigned ()->nullable ();
            $table->integer ('burn_on_attack')->unsigned ()->nullable ();
            $table->integer ('burn_on_defend')->unsigned ()->nullable ();
            $table->integer ('usable_rank_min')->unsigned ()->nullable ();
            $table->integer ('purchable_rank_min')->unsigned ()->nullable ();
            $table->integer ('reidentify_count')->unsigned ()->nullable ();
            $table->integer ('trade_in_abyss_point')->unsigned ()->nullable ();
            $table->boolean ('enchant_type')->nullable ();
            $table->integer ('recommend_rank')->unsigned ()->nullable ();
            $table->integer ('parts_slot_type')->unsigned ()->nullable ();
            $table->integer ('usable_rank_max')->unsigned ()->nullable ();
            $table->boolean ('blade_fx')->nullable ();
            $table->integer ('max_authorize')->unsigned ()->nullable ();
            $table->boolean ('authorize_condition')->nullable ();
            $table->integer ('gathering_point')->unsigned ()->nullable ();
            $table->integer ('dmg_decal')->unsigned ()->nullable ();
            $table->integer ('min_damage')->unsigned ()->nullable ();
            $table->integer ('max_damage')->unsigned ()->nullable ();
            /**
             * Removed Part as it's for Demo Showing only.
             *
             * @return Demo
             */



        });
    }


    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop ('client_items');
    }
}

Hope you'll like it :)

Administrator
Administrator
  • 1 year ago