Skip to content

Commit bc15998

Browse files
Nemo157Joshua Nelson
authored and
Joshua Nelson
committed
Add migration to mark doc_targets as non-nullable
1 parent 8fad200 commit bc15998

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/db/migrate.rs

+15
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,21 @@ pub fn migrate(version: Option<Version>, conn: &Connection) -> CratesfyiResult<(
310310
// downgrade query
311311
"DROP TABLE crate_priorities;",
312312
),
313+
migration!(
314+
context,
315+
// version
316+
12,
317+
// description
318+
"Mark doc_targets non-nullable (it has a default of empty array anyway)",
319+
// upgrade query
320+
"
321+
ALTER TABLE releases ALTER COLUMN doc_targets SET NOT NULL;
322+
",
323+
// downgrade query
324+
"
325+
ALTER TABLE releases ALTER COLUMN doc_targets DROP NOT NULL;
326+
"
327+
),
313328
];
314329

315330
for migration in migrations {

0 commit comments

Comments
 (0)