database-migrations

Create Sea-ORM database migrations for the Open Guard bot.

Updated Jan 9, 2026
One-click install
npx skills add https://github.com/ErdemGKSL/open-guard-rs --skill database-migrations-erdemgksl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/ErdemGKSL/open-guard-rs/tree/main/.opencode/skill/database-migrations
Command: npx skills add https://github.com/ErdemGKSL/open-guard-rs --skill database-migrations-erdemgksl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides developers in creating Sea-ORM database migrations for the Open Guard bot.

Core Features & Use Cases

  • Migration scaffolding: Provides templates and examples for up(), down(), and the overall migration structure under src/db/migrations.
  • Best practices: Demonstrates migration registration, atomic changes, and the use of indexes, foreign keys, and enums where applicable.
  • Use Case: When adding a new table or modifying existing schemas, follow the instructions to create migration files with a clear naming convention and proper rollback support.

Quick Start

Create a new migration file under src/db/migrations following the naming convention (for example m000012_your_migration_name.rs). Implement MigrationTrait with up() and down() methods and register the migration in src/db/migrations/mod.rs.

Frequently Asked Questions about database-migrations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create Sea-ORM database migrations for a Rust project?

To create Sea-ORM database migrations, you generate a migration file under src/db/migrations, implement the MigrationTrait with up() and down() methods, and register it in mod.rs to apply and rollback schema changes.

What naming convention should I use for Sea-ORM migration files?

Sea-ORM migration files should follow a sequential naming convention like m000012_your_migration_name.rs to ensure proper ordering and execution of database schema changes during migration workflows.

Do I need PostgreSQL to test Sea-ORM schema migrations?

Yes, you need a PostgreSQL-compatible database along with Rust tooling and Sea-ORM to implement, test, and verify database schema migrations including atomic changes, indexes, and foreign keys.

How do I add rollback support to a Sea-ORM database schema migration?

Rollback support in Sea-ORM migrations is added by implementing the down() method within your MigrationTrait to reverse the schema changes executed by the corresponding up() method.

What are the best practices for managing database schema versioning in Rust?

Best practices for database schema versioning include using atomic changes, adding indexes and foreign keys within migrations, following clear naming conventions, and registering each migration sequentially in mod.rs.

Can I use enums and foreign keys in Sea-ORM migration scripts?

Yes, Sea-ORM migration scripts support the use of enums, foreign keys, and indexes to define relational database schemas properly when creating or modifying tables through atomic migration changes.