Skip to content

Commit d6f3f32

Browse files
committed
Impl num enum
1 parent 12a7679 commit d6f3f32

File tree

22 files changed

+897
-433
lines changed

22 files changed

+897
-433
lines changed

crates/vespertide-cli/src/commands/diff.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ mod tests {
248248
#[case(
249249
MigrationAction::AddColumn {
250250
table: "users".into(),
251-
column: ColumnDef {
251+
column: Box::new(ColumnDef {
252252
name: "name".into(),
253253
r#type: ColumnType::Simple(SimpleColumnType::Text),
254254
nullable: true,
@@ -258,7 +258,7 @@ mod tests {
258258
unique: None,
259259
index: None,
260260
foreign_key: None,
261-
},
261+
}),
262262
fill_with: None,
263263
},
264264
format!("{} {}.{}", "Add column:".bright_green(), "users".bright_cyan(), "name".bright_cyan().bold())

crates/vespertide-cli/src/commands/sql.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ mod tests {
431431
version: 1,
432432
actions: vec![MigrationAction::AddColumn {
433433
table: "users".into(),
434-
column: ColumnDef {
434+
column: Box::new(ColumnDef {
435435
name: "nickname".into(),
436436
r#type: ColumnType::Simple(SimpleColumnType::Text),
437437
nullable: false,
@@ -441,7 +441,7 @@ mod tests {
441441
unique: None,
442442
index: None,
443443
foreign_key: None,
444-
},
444+
}),
445445
fill_with: Some("default".into()),
446446
}],
447447
};

crates/vespertide-core/src/action.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub enum MigrationAction {
2828
},
2929
AddColumn {
3030
table: TableName,
31-
column: ColumnDef,
31+
column: Box<ColumnDef>,
3232
/// Optional fill value to backfill existing rows when adding NOT NULL without default.
3333
fill_with: Option<String>,
3434
},
@@ -194,7 +194,7 @@ mod tests {
194194
#[case::add_column(
195195
MigrationAction::AddColumn {
196196
table: "users".into(),
197-
column: default_column(),
197+
column: Box::new(default_column()),
198198
fill_with: None,
199199
},
200200
"AddColumn: users.email"

crates/vespertide-core/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub mod schema;
55
pub use action::{MigrationAction, MigrationPlan};
66
pub use migration::{MigrationError, MigrationOptions};
77
pub use schema::{
8-
ColumnDef, ColumnName, ColumnType, ComplexColumnType, EnumValue, IndexDef, IndexName,
9-
ReferenceAction, SimpleColumnType, StrOrBoolOrArray, TableConstraint, TableDef, TableName,
10-
TableValidationError,
8+
ColumnDef, ColumnName, ColumnType, ComplexColumnType, EnumValues, IndexDef, IndexName,
9+
NumValue, ReferenceAction, SimpleColumnType, StrOrBoolOrArray, TableConstraint, TableDef,
10+
TableName, TableValidationError,
1111
};

0 commit comments

Comments
 (0)