Skip to content

Commit

Permalink
Merge pull request #4216 from habitat-sh/elliott/fix_with_gusto
Browse files Browse the repository at this point in the history
Migrate Null column to have value before setting it to not null
  • Loading branch information
chefsalim committed Dec 5, 2017
2 parents 9c6b803 + 0ba1e31 commit eed4f33
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,17 @@ pub fn migrate(migrator: &mut Migrator) -> SrvResult<()> {
END IF;
END $$"#,
)?;
migrator.migrate(
"originsrv",
"UPDATE origin_project_integrations SET updated_at = NOW() WHERE updated_at IS NULL;",
)?;
migrator.migrate(
"originsrv",
r#"ALTER TABLE origin_project_integrations
DROP COLUMN IF EXISTS name,
DROP COLUMN IF EXISTS integration,
DROP COLUMN IF EXISTS integration_name,
ALTER COLUMN IF EXISTS updated_at SET DEFAULT NOW(),
ALTER COLUMN body SET NOT NULL,
ALTER COLUMN created_at SET NOT NULL,
ALTER COLUMN updated_at SET NOT NULL,
Expand Down

0 comments on commit eed4f33

Please sign in to comment.