evento_sql_migrator/m0003/mod.rs
1//! Migration for schema refinements.
2//!
3//! This module widens the event `name` column to accommodate longer event type names.
4
5mod event;
6
7use sqlx_migrator::vec_box;
8
9/// Migration that widens the event `name` column.
10///
11/// ## Changes
12///
13/// 1. **Extends event.name column** - Changes the `name` column from VARCHAR(20)
14/// to VARCHAR(50) to accommodate longer event type names.
15///
16/// ## Database-Specific Notes
17///
18/// - **SQLite**: The column alteration is a no-op since SQLite doesn't support
19/// `ALTER COLUMN`. The column was already created with sufficient length.
20/// - **MySQL**: Uses `MODIFY COLUMN` syntax.
21/// - **PostgreSQL**: Uses standard `ALTER COLUMN` syntax.
22///
23/// ## Dependencies
24///
25/// This migration depends on [`M0002`](crate::M0002).
26pub struct M0003;
27
28#[cfg(feature = "sqlite")]
29sqlx_migrator::sqlite_migration!(
30 M0003,
31 "main",
32 "m0003",
33 vec_box![crate::M0002],
34 vec_box![event::alter_name_column::Operation,]
35);
36
37#[cfg(feature = "mysql")]
38sqlx_migrator::mysql_migration!(
39 M0003,
40 "main",
41 "m0003",
42 vec_box![crate::M0002],
43 vec_box![event::alter_name_column::Operation,]
44);
45
46#[cfg(feature = "postgres")]
47sqlx_migrator::postgres_migration!(
48 M0003,
49 "main",
50 "m0003",
51 vec_box![crate::M0002],
52 vec_box![event::alter_name_column::Operation,]
53);