Initial commit: Material Texture API service
- Go + Gin + GORM + PostgreSQL backend - RESTful API for material management - Docker deployment support - Database partitioning for billion-scale data - API documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
11
migrations/004_add_version_column.sql
Normal file
11
migrations/004_add_version_column.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- ============================================
|
||||
-- Migration: 004_add_version_column.sql
|
||||
-- Purpose: 添加乐观锁版本字段
|
||||
-- ============================================
|
||||
|
||||
-- 添加 version 字段到 materials 表 (用于乐观锁)
|
||||
ALTER TABLE materials
|
||||
ADD COLUMN IF NOT EXISTS version BIGINT NOT NULL DEFAULT 0;
|
||||
|
||||
-- 注释
|
||||
COMMENT ON COLUMN materials.version IS '乐观锁版本号,用于防止并发更新覆盖';
|
||||
Reference in New Issue
Block a user