This section contains some common information that will be useful for developers that need to do some db changes.
For columns it is possible to set ‘default’ or ‘server_default’. What is the difference between them and why should they be used?
The explanation is quite simple:
Summarizing, ‘default’ is useless in migrations and only ‘server_default’ should be used. For synchronizing migrations with models server_default parameter should also be added in model. If default value in database is not needed, ‘server_default’ should not be used. The declarative approach can be bypassed (i.e. ‘default’ may be omitted in the model) if default is enforced through business logic.
For details on the neutron-db-manage wrapper and alembic migrations, see Alembic Migrations.