Skip to content

Commit 0f90f99

Browse files
committed
Enusre gh_id is not null
1 parent 6e28c56 commit 0f90f99

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bin/migrate.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,15 @@ fn migrations() -> Vec<Migration> {
742742

743743
Migration::add_column(20160811151953, "users", "gh_id", "INTEGER"),
744744
index(20160811151954, "users", "gh_id"),
745+
Migration::new(20160812094501, |tx| {
746+
try!(tx.execute("ALTER TABLE users ALTER COLUMN gh_id \
747+
SET NOT NULL", &[]));
748+
Ok(())
749+
}, |tx| {
750+
try!(tx.execute("ALTER TABLE users ALTER COLUMN gh_id \
751+
DROP NOT NULL", &[]));
752+
Ok(())
753+
}),
745754
];
746755
// NOTE: Generate a new id via `date +"%Y%m%d%H%M%S"`
747756

0 commit comments

Comments
 (0)