File tree Expand file tree Collapse file tree 4 files changed +21
-5
lines changed Expand file tree Collapse file tree 4 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -16,20 +16,24 @@ path = "src/lib.rs"
1616
1717[dependencies ]
1818# Implements Eq and Order types for f64
19- ordered-float = { version = " 3.0 " }
19+ ordered-float = { version = " ~3 " }
2020
2121# serde defines (de-)serialization behaviour for structs and enums
22- serde = { version = " 1.0 " }
22+ serde = { version = " ~1 " }
2323
2424# Macros and Traits for working with enums
25- strum = { version = " ~0.24 " }
25+ strum = { version = " ~0.25 " }
2626
2727[build-dependencies ]
28- rustc_version = " 0.4.0 "
28+ rustc_version = { version = " ~ 0.4" }
2929
3030[features ]
3131default = [
3232 " ordered-float/serde" ,
3333 " serde/derive" ,
3434 " strum/derive"
35- ]
35+ ]
36+
37+ sqlite = []
38+ mysql = []
39+ postgres = []
Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ The representation of all supported DB drivers
99#[ serde( tag = "Driver" ) ]
1010pub enum DatabaseDriver {
1111 /// Representation of the SQLite driver
12+ #[ cfg( feature = "sqlite" ) ]
1213 #[ serde( rename_all = "PascalCase" ) ]
1314 SQLite {
1415 /// The filename of the sqlite database
1516 filename : String ,
1617 } ,
1718 /// Representation of the Postgres driver
19+ #[ cfg( feature = "postgres" ) ]
1820 #[ serde( rename_all = "PascalCase" ) ]
1921 Postgres {
2022 /// Name of the database
@@ -29,6 +31,7 @@ pub enum DatabaseDriver {
2931 password : String ,
3032 } ,
3133 /// Representation of the MySQL / MariaDB driver
34+ #[ cfg( feature = "mysql" ) ]
3235 #[ serde( rename_all = "PascalCase" ) ]
3336 MySQL {
3437 /// Name of the database
Original file line number Diff line number Diff line change @@ -128,6 +128,10 @@ pub enum DbType {
128128 Timestamp ,
129129 Time ,
130130 Choices ,
131+ Uuid ,
132+ MacAddress ,
133+ IpNetwork ,
134+ BitVec ,
131135}
132136
133137/// The subset of annotations which need to be communicated with the migration tool
Original file line number Diff line number Diff line change @@ -107,6 +107,11 @@ pub enum Operation {
107107 /// Representation of a RawSQL operation
108108 #[ serde( rename_all = "PascalCase" ) ]
109109 RawSQL {
110+ /// The provided raw sql does not change the structure of the database.
111+ /// The migrator can assume that the layout stayed the same and will continue
112+ /// generating new migrations based on `.models.json`
113+ #[ serde( default ) ]
114+ structure_safe : bool ,
110115 /// SQL for sqlite
111116 #[ serde( rename = "SQLite" ) ]
112117 sqlite : String ,
You can’t perform that action at this time.
0 commit comments