-
-
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.
Use BigInt for integer primary key in sqlite for diesel-cli
- Loading branch information
1 parent
7c4ba73
commit 1242ebd
Showing
41 changed files
with
945 additions
and
28 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
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
12 changes: 12 additions & 0 deletions
12
...el_cli/tests/generate_migrations/diff_add_table/sqlite/schema_out.rs/expected_i64_pk.snap
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,12 @@ | ||
--- | ||
source: diesel_cli/tests/migration_generate.rs | ||
description: "Test: diff_add_table" | ||
--- | ||
// @generated automatically by Diesel CLI. | ||
|
||
diesel::table! { | ||
users (id) { | ||
id -> BigInt, | ||
name -> Text, | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...enerate_migrations/diff_add_table_all_the_types/sqlite/schema_out.rs/expected_i64_pk.snap
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,42 @@ | ||
--- | ||
source: diesel_cli/tests/migration_generate.rs | ||
assertion_line: 354 | ||
description: "Test: diff_add_table_all_the_types" | ||
--- | ||
// @generated automatically by Diesel CLI. | ||
|
||
diesel::table! { | ||
all_the_types (id) { | ||
id -> BigInt, | ||
bool_column -> Bool, | ||
integer_column -> Integer, | ||
small_int_col -> SmallInt, | ||
big_int_col -> BigInt, | ||
binary_col -> Binary, | ||
text_col -> Text, | ||
double_col -> Double, | ||
float_col -> Float, | ||
numeric_col -> Double, | ||
date_col -> Date, | ||
timestamp_col -> Timestamp, | ||
time_col -> Time, | ||
float4_col -> Float, | ||
small_int2_col -> SmallInt, | ||
int2_col -> SmallInt, | ||
int4_col -> Integer, | ||
int8_col -> BigInt, | ||
big_int2_col -> BigInt, | ||
float8_col -> Float, | ||
decimal_col -> Double, | ||
varchar_col -> Text, | ||
varchar2_col -> Text, | ||
char_col -> Text, | ||
tinytext_col -> Text, | ||
mediumtext_col -> Text, | ||
tinyblob_col -> Binary, | ||
blob_col -> Binary, | ||
longblob_col -> Binary, | ||
mediumblob_col -> Binary, | ||
varbinary_col -> Binary, | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
diesel_cli/tests/generate_migrations/diff_add_table_with_fk/schema_i64_pk.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,17 @@ | ||
diesel::table! { | ||
users { | ||
id -> BigInt, | ||
name -> Text, | ||
} | ||
} | ||
|
||
diesel::table! { | ||
posts { | ||
id -> BigInt, | ||
title -> Text, | ||
body -> Nullable<Text>, | ||
user_id -> Integer, | ||
} | ||
} | ||
|
||
diesel::joinable!(posts -> users (user_id)); |
29 changes: 29 additions & 0 deletions
29
...ests/generate_migrations/diff_add_table_with_fk/sqlite/schema_out.rs/expected_i64_pk.snap
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,29 @@ | ||
--- | ||
source: diesel_cli/tests/migration_generate.rs | ||
assertion_line: 332 | ||
description: "Test: diff_add_table_with_fk" | ||
--- | ||
// @generated automatically by Diesel CLI. | ||
|
||
diesel::table! { | ||
posts (id) { | ||
id -> BigInt, | ||
title -> Text, | ||
body -> Nullable<Text>, | ||
user_id -> Integer, | ||
} | ||
} | ||
|
||
diesel::table! { | ||
users (id) { | ||
id -> BigInt, | ||
name -> Text, | ||
} | ||
} | ||
|
||
diesel::joinable!(posts -> users (user_id)); | ||
|
||
diesel::allow_tables_to_appear_in_same_query!( | ||
posts, | ||
users, | ||
); |
7 changes: 7 additions & 0 deletions
7
diesel_cli/tests/generate_migrations/diff_alter_table_add_column/schema_i64_pk.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,7 @@ | ||
table! { | ||
users { | ||
id -> BigInt, | ||
name -> Text, | ||
hair_color -> Nullable<Text>, | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...generate_migrations/diff_alter_table_add_column/sqlite/schema_out.rs/expected_i64_pk.snap
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,14 @@ | ||
--- | ||
source: diesel_cli/tests/migration_generate.rs | ||
assertion_line: 327 | ||
description: "Test: diff_alter_table_add_column" | ||
--- | ||
// @generated automatically by Diesel CLI. | ||
|
||
diesel::table! { | ||
users (id) { | ||
id -> BigInt, | ||
name -> Text, | ||
hair_color -> Nullable<Text>, | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
diesel_cli/tests/generate_migrations/diff_alter_table_drop_column/schema_i64_pk.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,5 @@ | ||
table! { | ||
users { | ||
id -> BigInt, | ||
} | ||
} |
Oops, something went wrong.