Skip to content

Commit af89c4f

Browse files
committed
feat: derive Serialize for Migration if serde is enabled
1 parent b7c8d44 commit af89c4f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

refinery_core/src/runner.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use std::fmt::Formatter;
1414

1515
/// An enum set that represents the type of the Migration
1616
#[derive(Clone, PartialEq)]
17+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1718
pub enum Type {
1819
Versioned,
1920
Unversioned,
@@ -51,6 +52,7 @@ pub enum Target {
5152
// an Enum set that represents the state of the migration: Applied on the database,
5253
// or Unapplied yet to be applied on the database
5354
#[derive(Clone, Debug)]
55+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5456
enum State {
5557
Applied,
5658
Unapplied,
@@ -62,6 +64,7 @@ enum State {
6264
///
6365
/// [`embed_migrations!`]: macro.embed_migrations.html
6466
#[derive(Clone, Debug)]
67+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6568
pub struct Migration {
6669
state: State,
6770
name: String,

0 commit comments

Comments
 (0)