update store

This commit is contained in:
2025-12-03 16:38:41 +08:00
parent db4824b776
commit a7cd73d9e7
2 changed files with 13 additions and 2 deletions
@@ -24,10 +24,17 @@ return new class extends Migration
->default(8)
->after('platform_meta')
->comment('平台店铺统计时使用的时区 默认为 +8 表示 北京时间, 如果是日本则是 +7, 填写基于 UTC 的偏移值');
// 在 timezone 后添加 auth 字段
$table->jsonb('auth')
->nullable()
->after('timezone')
->comment('电商平台开放接口的授权信息(可选)');
});
// 为 platform_meta JSONB 字段创建 GIN 索引,支持高效的 JSON 查询
// 为 JSONB 字段创建 GIN 索引,支持高效的 JSON 查询
Db::statement('CREATE INDEX idx_stores_platform_meta ON stores USING GIN (platform_meta)');
Db::statement('CREATE INDEX idx_stores_auth ON stores USING GIN (auth)');
}
/**
@@ -37,10 +44,11 @@ return new class extends Migration
{
// 删除 GIN 索引
Db::statement('DROP INDEX IF EXISTS idx_stores_platform_meta');
Db::statement('DROP INDEX IF EXISTS idx_stores_auth');
Schema::table('stores', function (Blueprint $table) {
// 删除添加的字段
$table->dropColumn(['platform_meta', 'timezone']);
$table->dropColumn(['platform_meta', 'timezone', 'auth']);
});
}
};