Setting up the database¶
Apache Airflow® requires a database. If you’re just experimenting and learning Airflow, you can stick with the default SQLite option. If you don’t want to use SQLite, then take a look at Set up a Database Backend to setup a different database.
Usually, you need to run airflow db migrate
in order to create the database schema if it does not exist
or migrate to the latest version if it does. You should make sure that Airflow components are
not running while the database migration is being executed.
Note
Prior to Airflow version 2.7.0, airflow db upgrade
was used to apply migrations,
however, it has been deprecated in favor of airflow db migrate
.
In some deployments, such as Helm Chart for Apache Airflow, both initializing and running the database migration is executed automatically when Airflow is upgraded.
Sometimes, after the upgrade, you are also supposed to do some post-migration actions. See Upgrading Apache Airflow® to a newer version for more details about upgrading and doing post-migration actions.