TRIGGER when user asks to rename the database table used by a SQL CRUD microservice. Creates a SQL migration and updates all table references.
Scanned 6/6/2026
Install via CLI
openskills install microbus-io/fabric---
name: rename-sql-table
description: TRIGGER when user asks to rename the database table used by a SQL CRUD microservice. Creates a SQL migration and updates all table references.
---
**CRITICAL**: Read and analyze this microservice before starting. Do NOT explore or analyze other microservices unless explicitly instructed to do so. The instructions in this skill are self-contained to this microservice.
**IMPORTANT**: `old_table_name` and `new_table_name` are placeholders for the actual old and new table names.
## Workflow
Copy this checklist and track your progress:
```
Renaming the database table:
- [ ] Step 1: Update Table Name Const
- [ ] Step 2: Update Database Schema
- [ ] Step 3: Housekeeping
```
#### Step 1: Update Table Name Const
Update the `tableName` const in `service.go` to the new table name. Do NOT change the `sequenceName`.
```go
const (
tableName = "new_table_name"
sequenceName = "old_table_name@0f7ce540" // Do not change
// ...
)
```
#### Step 2: Update Database Schema
Create a new migration script file in `resources/sql` with an incremental file name. **IMPORTANT**: Do not edit an existing migration file.
```sql
-- DRIVER: mysql
RENAME TABLE old_table_name TO new_table_name;
-- DRIVER: pgx
ALTER TABLE old_table_name RENAME TO new_table_name;
-- DRIVER: mssql
EXEC sp_rename 'old_table_name', 'new_table_name';
```
Refer to the older `.sql` migration files to identify what if any indices were associated with the old table name. Append statements to the migration script to rename these indices, replacing the old table name with the new one.
```sql
-- DRIVER: mysql
ALTER TABLE new_table_name RENAME INDEX old_table_name_idx_field TO new_table_name_idx_field;
-- DRIVER: pgx
ALTER INDEX old_table_name_idx_field RENAME TO new_table_name_idx_field;
-- DRIVER: mssql
EXEC sp_rename 'old_table_name_idx_field', 'new_table_name_idx_field', 'INDEX';
```
#### Step 3: Housekeeping
Follow the `housekeeping` skill. Skip the manifest, topology and tidy up steps.
No comments yet. Be the first to comment!
MySQL development best practices for schema design, query optimization, and database administration
Spring Boot中的JPA/Hibernate实体设计、关系、查询优化、事务、审计、索引、分页和连接池模式。
基于Supabase最佳实践的PostgreSQL数据库模式,用于查询优化、架构设计、索引和安全。
ClickHouse数据库模式、查询优化、分析和数据工程最佳实践,适用于高性能分析工作负载。
Decide where to place TiDB tests and how to write them (basic structure, naming, testdata usage). Use when asked about test locations, writing conventions, shard_count limits, casetest categorization, or when reviewing test changes in code review.