Skip to content

Commit 846add3

Browse files
Nemo157jyn514
authored andcommitted
Support 1.63 running doc-tests on private macros
1 parent fd65888 commit 846add3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/db/migrate.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use schemamama_postgres::{PostgresAdapter, PostgresMigration};
1111
///
1212
/// Example:
1313
///
14-
/// ```
14+
/// ```no_compile
1515
/// let my_migration = migration!(100,
1616
/// "migrate data",
1717
/// |transaction: &mut Transaction| -> Result<(), PostgresError> {
@@ -73,7 +73,7 @@ macro_rules! migration {
7373
///
7474
/// Example:
7575
///
76-
/// ```
76+
/// ```no_compile
7777
/// let my_migration = sql_migration!(100,
7878
/// "Create test table",
7979
/// "CREATE TABLE test ( id SERIAL);",
@@ -650,7 +650,7 @@ pub fn migrate(version: Option<Version>, conn: &mut Client) -> crate::error::Res
650650
sql_migration!(
651651
context,
652652
26,
653-
"create indexes for crates, github_repos and releases",
653+
"create indexes for crates, github_repos and releases",
654654
// upgrade
655655
"
656656
CREATE INDEX crates_latest_version_idx ON crates (latest_version_id);
@@ -788,7 +788,7 @@ pub fn migrate(version: Option<Version>, conn: &mut Client) -> crate::error::Res
788788
"ALTER TABLE releases DROP COLUMN archive_storage;",
789789
),
790790
sql_migration!(
791-
context, 31, "add index on builds.build_time",
791+
context, 31, "add index on builds.build_time",
792792
"CREATE INDEX builds_build_time_idx ON builds (build_time DESC);",
793793
"DROP INDEX builds_build_time_idx;",
794794
),
@@ -800,14 +800,14 @@ pub fn migrate(version: Option<Version>, conn: &mut Client) -> crate::error::Res
800800
use crate::web::crate_details::CrateDetails;
801801
let rows = transaction.query(
802802
"SELECT crates.name, max(releases.version) as max_version_id
803-
FROM crates
804-
INNER JOIN releases ON crates.id = releases.crate_id
803+
FROM crates
804+
INNER JOIN releases ON crates.id = releases.crate_id
805805
GROUP BY crates.name",
806806
&[],
807807
)?;
808808

809809
let update_version_query = transaction.prepare(
810-
"UPDATE crates
810+
"UPDATE crates
811811
SET latest_version_id = $2
812812
WHERE id = $1",
813813
)?;
@@ -827,10 +827,10 @@ pub fn migrate(version: Option<Version>, conn: &mut Client) -> crate::error::Res
827827
|transaction: &mut Transaction| -> Result<(), PostgresError> {
828828
transaction
829829
.execute(
830-
"UPDATE crates
830+
"UPDATE crates
831831
SET latest_version_id = (
832-
SELECT max(id)
833-
FROM releases
832+
SELECT max(id)
833+
FROM releases
834834
WHERE releases.crate_id = crates.id
835835
)",
836836
&[],

0 commit comments

Comments
 (0)