-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3202 from weiznich/fix/1535
Fix #1535
- Loading branch information
Showing
5 changed files
with
69 additions
and
7 deletions.
There are no files selected for viewing
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
2 changes: 2 additions & 0 deletions
2
diesel_cli/tests/print_schema/print_schema_sqlite_implicit_foreign_key_reference/diesel.toml
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[print_schema] | ||
file = "src/schema.rs" |
24 changes: 24 additions & 0 deletions
24
.../tests/print_schema/print_schema_sqlite_implicit_foreign_key_reference/sqlite/expected.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// @generated automatically by Diesel CLI. | ||
|
||
diesel::table! { | ||
accounts (id) { | ||
id -> Integer, | ||
account -> Text, | ||
data_center_id -> Integer, | ||
auth_key -> Binary, | ||
} | ||
} | ||
|
||
diesel::table! { | ||
data_centers (id) { | ||
id -> Integer, | ||
name -> Text, | ||
} | ||
} | ||
|
||
diesel::joinable!(accounts -> data_centers (data_center_id)); | ||
|
||
diesel::allow_tables_to_appear_in_same_query!( | ||
accounts, | ||
data_centers, | ||
); |
13 changes: 13 additions & 0 deletions
13
...i/tests/print_schema/print_schema_sqlite_implicit_foreign_key_reference/sqlite/schema.sql
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CREATE TABLE data_centers ( | ||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
name TEXT NOT NULL | ||
); | ||
|
||
CREATE TABLE accounts ( | ||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
account TEXT NOT NULL, | ||
data_center_id INTEGER NOT NULL, | ||
auth_key BLOB NOT NULL, | ||
UNIQUE (account, data_center_id), | ||
FOREIGN KEY (data_center_id) REFERENCES data_centers | ||
); |