From 940ed3381409e79d3b9820512a19d57c930deb06 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 02 2015 10:23:12 +0000 Subject: Set a default when adding the closed_at column --- diff --git a/alembic/versions/1cd0a853c697_add_closed_at_field_in_pr.py b/alembic/versions/1cd0a853c697_add_closed_at_field_in_pr.py index 0ecf8b3..d6eef26 100644 --- a/alembic/versions/1cd0a853c697_add_closed_at_field_in_pr.py +++ b/alembic/versions/1cd0a853c697_add_closed_at_field_in_pr.py @@ -27,6 +27,9 @@ def upgrade(): ) ) + op.execute('''UPDATE "pull_requests" SET closed_at=date_created ''' + '''WHERE STATUS != 'Open';''') + def downgrade(): ''' Remove the column closed_at from the table pull_requests.