-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unqiue constraint for model fields
May be specified by adding #[unique] to a field
- Loading branch information
1 parent
e26ce3d
commit 2770b50
Showing
17 changed files
with
73 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "butane" | ||
version = "0.3.0" | ||
version = "0.3.1" | ||
authors = ["James Oakley <[email protected]>"] | ||
edition = "2018" | ||
description = "An ORM with a focus on simplicity and on writing Rust, not SQL." | ||
|
@@ -23,8 +23,8 @@ tls = ["butane_core/tls"] | |
uuid = ["butane_core/uuid", "butane_codegen/uuid"] | ||
|
||
[dependencies] | ||
butane_codegen = { path = "../butane_codegen", version = "0.3.0" } | ||
butane_core = { path = "../butane_core", version = "0.3.0" } | ||
butane_codegen = { path = "../butane_codegen", version = "0.3.1" } | ||
butane_core = { path = "../butane_core", version = "0.3.1" } | ||
|
||
|
||
[dev-dependencies] | ||
|
@@ -38,6 +38,7 @@ proc-macro2="1.0" | |
once_cell="1.5.2" | ||
postgres = { version = "0.19", features=["with-geo-types-0_7"] } | ||
r2d2_for_test = {package="r2d2", version = "0.8"} | ||
rusqlite = "0.25" | ||
uuid_for_test = {package="uuid", version = "0.8", features=["v4"] } | ||
|
||
[package.metadata.docs.rs] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "butane_cli" | ||
version = "0.3.0" | ||
version = "0.3.1" | ||
authors = ["James Oakley <[email protected]>"] | ||
edition = "2018" | ||
description = "The CLI for the Butane ORM" | ||
|
@@ -15,7 +15,7 @@ path = "src/main.rs" | |
|
||
[dependencies] | ||
anyhow = "1.0" | ||
butane = { path="../butane", version="0.3", features=["default", "sqlite", "pg"] } | ||
butane = { path="../butane", version="0.3.1", features=["default", "sqlite", "pg"] } | ||
chrono = "0.4" | ||
clap = "2.33" | ||
quote = "1.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "butane_codegen" | ||
version = "0.3.0" | ||
version = "0.3.1" | ||
authors = ["James Oakley <[email protected]>"] | ||
edition = "2018" | ||
description = "Macros for Butane. Do not use this crate directly -- use the butane crate." | ||
|
@@ -13,7 +13,7 @@ datetime = [] | |
|
||
[dependencies] | ||
proc-macro2 = "1.0" | ||
butane_core = { path = "../butane_core", version = "0.3.0" } | ||
butane_core = { path = "../butane_core", version = "0.3.1" } | ||
quote = "1.0" | ||
syn = { version = "1.0", features = ["full", "extra-traits"] } | ||
uuid = {version = "0.8", optional=true} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "butane_core" | ||
version = "0.3.0" | ||
version = "0.3.1" | ||
authors = ["James Oakley <[email protected]>"] | ||
edition = "2018" | ||
description = "Internals for Butane. Do not use this crate directly -- use the butane crate." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"name":"Blog","columns":[{"name":"id","sqltype":{"KnownId":{"Ty":"BigInt"}},"nullable":false,"pk":true,"auto":true,"default":null},{"name":"name","sqltype":{"KnownId":{"Ty":"Text"}},"nullable":false,"pk":false,"auto":false,"default":null}]} | ||
{"name":"Blog","columns":[{"name":"id","sqltype":{"KnownId":{"Ty":"BigInt"}},"nullable":false,"pk":true,"auto":true,"unique":false,"default":null},{"name":"name","sqltype":{"KnownId":{"Ty":"Text"}},"nullable":false,"pk":false,"auto":false,"unique":false,"default":null}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"name":"Post","columns":[{"name":"id","sqltype":{"KnownId":{"Ty":"Int"}},"nullable":false,"pk":true,"auto":true,"default":null},{"name":"title","sqltype":{"KnownId":{"Ty":"Text"}},"nullable":false,"pk":false,"auto":false,"default":null},{"name":"body","sqltype":{"KnownId":{"Ty":"Text"}},"nullable":false,"pk":false,"auto":false,"default":null},{"name":"published","sqltype":{"KnownId":{"Ty":"Bool"}},"nullable":false,"pk":false,"auto":false,"default":null},{"name":"blog","sqltype":{"Deferred":"PK:Blog"},"nullable":false,"pk":false,"auto":false,"default":null},{"name":"byline","sqltype":{"KnownId":{"Ty":"Text"}},"nullable":true,"pk":false,"auto":false,"default":null},{"name":"likes","sqltype":{"KnownId":{"Ty":"Int"}},"nullable":false,"pk":false,"auto":false,"default":null}]} | ||
{"name":"Post","columns":[{"name":"id","sqltype":{"KnownId":{"Ty":"Int"}},"nullable":false,"pk":true,"auto":true,"unique":false,"default":null},{"name":"title","sqltype":{"KnownId":{"Ty":"Text"}},"nullable":false,"pk":false,"auto":false,"unique":false,"default":null},{"name":"body","sqltype":{"KnownId":{"Ty":"Text"}},"nullable":false,"pk":false,"auto":false,"unique":false,"default":null},{"name":"published","sqltype":{"KnownId":{"Ty":"Bool"}},"nullable":false,"pk":false,"auto":false,"unique":false,"default":null},{"name":"blog","sqltype":{"Deferred":"PK:Blog"},"nullable":false,"pk":false,"auto":false,"unique":false,"default":null},{"name":"byline","sqltype":{"KnownId":{"Ty":"Text"}},"nullable":true,"pk":false,"auto":false,"unique":false,"default":null},{"name":"likes","sqltype":{"KnownId":{"Ty":"Int"}},"nullable":false,"pk":false,"auto":false,"unique":false,"default":null}]} |
2 changes: 1 addition & 1 deletion
2
examples/getting_started/.butane/migrations/current/Post_tags_Many.table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"name":"Post_tags_Many","columns":[{"name":"owner","sqltype":{"KnownId":{"Ty":"Int"}},"nullable":false,"pk":false,"auto":false,"default":null},{"name":"has","sqltype":{"Deferred":"PK:Tag"},"nullable":false,"pk":false,"auto":false,"default":null}]} | ||
{"name":"Post_tags_Many","columns":[{"name":"owner","sqltype":{"KnownId":{"Ty":"Int"}},"nullable":false,"pk":false,"auto":false,"unique":false,"default":null},{"name":"has","sqltype":{"Deferred":"PK:Tag"},"nullable":false,"pk":false,"auto":false,"unique":false,"default":null}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"name":"Tag","columns":[{"name":"tag","sqltype":{"KnownId":{"Ty":"Text"}},"nullable":false,"pk":true,"auto":false,"default":null}]} | ||
{"name":"Tag","columns":[{"name":"tag","sqltype":{"KnownId":{"Ty":"Text"}},"nullable":false,"pk":true,"auto":false,"unique":false,"default":null}]} |