SQL handling via diesel
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
@@ -16,3 +16,10 @@ opt-level = "z"
|
||||
version = "2.33"
|
||||
default-features = false
|
||||
features = [ "suggestions", "color", "yaml" ]
|
||||
|
||||
[dependencies.diesel]
|
||||
version = "1.4.0"
|
||||
features = [ "postgres", "sqlite" ]
|
||||
|
||||
[dependencies.dotenv]
|
||||
version = "0.10.0"
|
||||
|
||||
5
diesel.toml
Normal file
5
diesel.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
# For documentation on how to configure this file,
|
||||
# see diesel.rs/guides/configuring-diesel-cli
|
||||
|
||||
[print_schema]
|
||||
file = "src/schema.rs"
|
||||
36
src/schema.rs
Normal file
36
src/schema.rs
Normal file
@@ -0,0 +1,36 @@
|
||||
table! {
|
||||
User (id) {
|
||||
id -> Integer,
|
||||
userId -> Integer,
|
||||
email -> Text,
|
||||
emailConfirmed -> Integer,
|
||||
passwordHash -> Text,
|
||||
initials -> Text,
|
||||
lastName -> Text,
|
||||
firstName -> Text,
|
||||
}
|
||||
UserRole (id) {
|
||||
id -> Integer,
|
||||
name -> Text,
|
||||
}
|
||||
UserUserRole (id) {
|
||||
userId -> Integer,
|
||||
roleId -> Integer,
|
||||
}
|
||||
UserClaim (id) {
|
||||
id -> Integer,
|
||||
userId -> Integer,
|
||||
type -> Text,
|
||||
value -> Text,
|
||||
}
|
||||
NumberHarm (id) {
|
||||
id -> Integer,
|
||||
numberHarm -> Text,
|
||||
numberPolicyholder -> Text,
|
||||
numberCollback -> Text,
|
||||
dateRecording -> Date,
|
||||
userId -> Integer,
|
||||
dateChanged -> Date,
|
||||
userIdChanged -> Integer,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user