feat: delete

This commit is contained in:
hashbro
2026-09-02 04:54:28 +08:00
parent 5d64323191
commit 44bcfe544c
7 changed files with 99 additions and 27 deletions
@@ -12,13 +12,13 @@ return new class extends Migration
return;
}
$type = Schema::getColumnType('plugin_sessions', 'kind');
if (in_array($type, ['integer', 'tinyinteger', 'smallinteger', 'bigint'], true)) {
$type = strtolower((string) Schema::getColumnType('plugin_sessions', 'kind'));
if (in_array($type, ['integer', 'tinyint', 'tinyinteger', 'smallint', 'smallinteger', 'bigint'], true)) {
return;
}
DB::table('plugin_sessions')->where('kind', 'telegram')->update(['kind' => '1']);
DB::table('plugin_sessions')->where('kind', 'whatsapp')->update(['kind' => '2']);
DB::table('plugin_sessions')->where('kind', 'telegram')->update(['kind' => 1]);
DB::table('plugin_sessions')->where('kind', 'whatsapp')->update(['kind' => 2]);
$driver = Schema::getConnection()->getDriverName();
if ($driver === 'mysql') {