PATH:
home
/
lab2454c
/
costbloc.com
/
database
/
migrations
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateTransactionsTable extends Migration { public function up() { Schema::create('transactions', function (Blueprint $table) { $table->bigIncrements('id'); $table->bigInteger('user_id')->nullable()->index()->comment('Who paid for this transaction'); $table->integer('currency_id')->unsigned()->index(); $table->integer('account_id')->nullable()->index()->comment('account_id refers accounts table id'); $table->bigInteger('shop_id')->nullable()->index(); $table->bigInteger('vendor_id')->nullable()->index(); $table->bigInteger('order_id')->unsigned()->nullable()->index(); $table->integer('withdrawal_method_id')->unsigned()->nullable()->index(); $table->integer('exchange_currency_id')->nullable()->unsigned()->index(); $table->decimal('exchange_rate', 12, 8)->nullable(); $table->decimal('amount', 16, 8)->nullable()->comment('product amount'); $table->decimal('charge_amount', 16, 8)->nullable()->comment('payment processor fee'); $table->decimal('commission_amount', 16, 8)->nullable()->comment('admin/platform fee'); $table->decimal('discount_amount', 16, 8)->nullable()->comment('amount user got as discount'); $table->decimal('paid_amount', 16, 8)->nullable()->comment('payer paid after discount'); $table->decimal('total_amount', 16, 8)->index()->nullable()->comment('Receiver amount after all fees'); $table->string('transaction_type', 100)->index(); $table->date('transaction_date')->index(); $table->string('reference_number', 100)->nullable()->index(); $table->string('reference_type', 50)->nullable()->index(); $table->text('description', 1000)->nullable(); $table->text('params')->nullable(); $table->string('status', 20)->comment('Pending/Rejected/Accepted'); $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrentOnUpdate()->nullable(); }); } public function down() { Schema::dropIfExists('transactions'); } }
[+]
..
[-] 2021_10_10_065928_add_foreign_keys_to_favourites_table.php
[edit]
[-] 2021_10_10_065927_create_vendor_users_table.php
[edit]
[-] 2021_10_10_065927_create_flash_sales_table.php
[edit]
[-] 2022_01_18_072726_create_brand_stats_table.php
[edit]
[-] 2022_02_15_0000042_add_foreign_keys_to_user_withdrawal_settings_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_attributes_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_subscription_invoice_items_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_reviews_table.php
[edit]
[-] 2022_09_05_073603_add_foreign_keys_to_orders_meta_table.php
[edit]
[-] 2016_06_01_000005_create_oauth_personal_access_clients_table.php
[edit]
[-] 2021_10_10_065927_create_languages_table.php
[edit]
[-] 2022_01_31_093341_create_order_status_roles_table.php
[edit]
[-] 2021_10_10_065928_create_addresses_table.php
[edit]
[-] 2021_10_10_065927_create_categories_table.php
[edit]
[-] 2021_10_10_065927_create_reviews_table.php
[edit]
[-] 2021_10_10_065927_create_email_templates_table.php
[edit]
[-] 2021_11_25_072726_category_trigger.php
[edit]
[-] 2022_02_15_0000041_create_user_withdrawal_settings_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_product_tags_table.php
[edit]
[-] 2022_02_15_0000043_create_transactions_table.php
[edit]
[-] 2016_06_01_000001_create_oauth_auth_codes_table.php
[edit]
[-] 2022_05_18_094636_create_metas.php
[edit]
[-] 2022_05_18_092820_create_user_searches_table.php
[edit]
[-] 2021_10_10_065927_create_products_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_products_table.php
[edit]
[-] 2021_10_10_065927_create_category_attributes_table.php
[edit]
[-] 2021_10_10_065927_create_product_tags_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_product_cross_sales_table.php
[edit]
[-] 2021_10_10_065927_create_preferences_table.php
[edit]
[-] 2022_05_18_074840_create_users_meta.php
[edit]
[-] 2021_10_10_065927_create_role_users_table.php
[edit]
[-] 2021_10_10_065927_create_subscription_invoices_table.php
[edit]
[-] 2021_10_10_065927_create_vendors_table.php
[edit]
[-] 2021_10_10_065927_create_currencies_table.php
[edit]
[-] 2021_10_10_065927_create_email_configurations_table.php
[edit]
[-] 2016_06_01_000004_create_oauth_clients_table.php
[edit]
[-] 2021_12_16_111713_add_foreign_keys_to_order_details_table.php
[edit]
[-] 2022_02_13_0000035_create_wallets_table.php
[edit]
[-] 2021_10_10_065927_create_product_relates_table.php
[edit]
[-] 2022_02_15_0000044_add_foreign_keys_to_transactions_table.php
[edit]
[-] 2022_01_18_072726_create_category_stats_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_product_relates_table.php
[edit]
[-] 2022_06_01_052414_add_foreign_keys_to_order_note_histories_table.php
[edit]
[-] 2021_10_10_065927_create_attribute_groups_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_attribute_values_table.php
[edit]
[-] 2021_10_10_065927_create_users_table.php
[edit]
[-] 2021_10_10_065929_add_foreign_keys_to_addresses_table.php
[edit]
[-] 2021_10_10_065927_create_locations_table.php
[edit]
[-] 2021_11_25_072702_tag_trigger.php
[edit]
[-] 2021_10_10_065927_create_product_categories_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_categories_table.php
[edit]
[-] 2021_10_10_065927_create_tags_table.php
[edit]
[-] 2021_10_10_065927_create_product_cross_sales_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_permission_roles_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_role_users_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_product_categories_table.php
[edit]
[-] 2022_06_07_050839_create_products_meta_table.php
[edit]
[-] 2021_10_10_065927_create_translations_table.php
[edit]
[-] 2021_10_10_065927_create_brands_table.php
[edit]
[-] 2016_06_01_000003_create_oauth_refresh_tokens_table.php
[edit]
[-] 2022_10_30_062626_create_activity_log_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_vendor_users_table.php
[edit]
[-] 2021_10_10_065927_create_backups_table.php
[edit]
[-] 2021_10_10_065927_create_subscription_invoice_items_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_email_templates_table.php
[edit]
[-] 2021_10_10_065927_create_password_resets_table.php
[edit]
[-] 2022_01_31_093342_add_foreign_keys_to_order_status_roles_table.php
[edit]
[-] 2022_04_06_104629_add_foreign_keys_to_seos_table.php
[edit]
[-] 2022_01_18_072726_product_trigger.php
[edit]
[-] 2021_12_16_111710_create_orders_table.php
[edit]
[-] 2021_11_25_072727_product_category_trigger.php
[edit]
[-] 2021_10_10_065927_create_failed_jobs_table.php
[edit]
[-] 2021_10_10_065927_create_favourites_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_wishlists_table.php
[edit]
[-] 2022_01_31_093451_add_foreign_keys_to_order_status_histories_table.php
[edit]
[-] 2016_06_01_000002_create_oauth_access_tokens_table.php
[edit]
[-] 2022_02_13_0000037_add_foreign_keys_to_wallets_table.php
[edit]
[-] 2021_12_16_111712_create_order_details_table.php
[edit]
[-] 2021_10_10_065927_create_wishlists_table.php
[edit]
[-] 2021_10_10_065927_create_countries_table.php
[edit]
[-] 2022_08_22_073603_add_foreign_keys_to_products_meta_table.php
[edit]
[-] 2021_10_10_065927_create_permissions_table.php
[edit]
[-] 2022_09_04_050839_create_orders_meta_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_category_attributes_table.php
[edit]
[-] 2022_06_01_052314_create_order_note_histories_table.php
[edit]
[-] 2021_12_16_111707_create_order_statuses_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_brands_table.php
[edit]
[-] 2022_02_15_0000040_create_withdrawal_methods_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_flash_sales_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_attribute_groups_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_roles_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_tags_table.php
[edit]
[-] 2021_10_10_065927_create_attributes_table.php
[edit]
[-] 2022_01_31_093450_create_order_status_histories_table.php
[edit]
[-] 2021_10_10_065928_add_foreign_keys_to_product_upsales_table.php
[edit]
[-] 2022_05_18_092821_add_foreign_keys_to_user_searches_table.php
[edit]
[-] 2022_04_06_104628_create_seos_table.php
[edit]
[-] 2022_01_18_072726_create_product_stats_table.php
[edit]
[-] 2021_12_16_111711_add_foreign_keys_to_orders_table.php
[edit]
[-] 2021_10_10_065927_create_permission_roles_table.php
[edit]
[-] 2021_10_10_065927_create_product_upsales_table.php
[edit]
[-] 2022_05_18_092750_create_searches_table.php
[edit]
[-] 2021_10_10_065927_create_subscription_quotes_table.php
[edit]
[-] 2021_10_10_065927_create_attribute_values_table.php
[edit]
[-] 2022_10_03_060019_create_vendors_meta_table.php
[edit]
[-] 2021_10_10_065927_create_roles_table.php
[edit]