Skip to content

Commit fbfbb6b

Browse files
RMCreanbrinkdp
andauthored
Apply suggestions from code review
Co-authored-by: Daniel P Brink <daniel.brink@scilifelab.se>
1 parent ab876ba commit fbfbb6b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

docs/development/database-migrations.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ def upgrade() -> None:
136136
# see e.g. here for why: https://github.com/sqlalchemy/alembic/discussions/1433
137137
op.add_column('user', sa.Column('organisation', sa.String(length=200), nullable=False, server_default=sa.text("'Not specified'"),))
138138

139-
# At the end of the same migration script, remove the server_default from the column - so our models match exactly with the database schema.
140-
# New rows will now require the application to provide a value and any existing rows is now populated.
139+
# Any rows in the database table that existed before the migration will now be populated with the default value 'Not specified'.
140+
# At the end of the same migration script, remove the server_default param from the column (with `server_default=None`) - so our models match exactly with the database schema.
141+
# New rows will now require the application to provide a value for the organisation column.
141142
op.alter_column('user', 'organisation', server_default=None)
142143
```
143144

0 commit comments

Comments
 (0)