feat: autotransfer
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('wallet_addresses', function (Blueprint $table) {
|
||||
$table->foreignId('mnemonic_id')
|
||||
->nullable()
|
||||
->after('source')
|
||||
->constrained('wallet_mnemonics')
|
||||
->nullOnDelete();
|
||||
$table->unsignedTinyInteger('derive_index')
|
||||
->nullable()
|
||||
->after('mnemonic_id');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('wallet_addresses', function (Blueprint $table) {
|
||||
$table->dropConstrainedForeignId('mnemonic_id');
|
||||
$table->dropColumn('derive_index');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->boolean('auto_transfer_enabled')->default(false)->after('chat_id');
|
||||
$table->decimal('auto_transfer_threshold_usdt', 24, 8)->nullable()->after('auto_transfer_enabled');
|
||||
$table->decimal('auto_transfer_threshold_trx', 24, 8)->nullable()->after('auto_transfer_threshold_usdt');
|
||||
$table->decimal('auto_transfer_threshold_eth', 24, 8)->nullable()->after('auto_transfer_threshold_trx');
|
||||
$table->decimal('auto_transfer_threshold_btc', 24, 8)->nullable()->after('auto_transfer_threshold_eth');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'auto_transfer_enabled',
|
||||
'auto_transfer_threshold_usdt',
|
||||
'auto_transfer_threshold_trx',
|
||||
'auto_transfer_threshold_eth',
|
||||
'auto_transfer_threshold_btc',
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user