potiuk commented on issue #32420:
URL: https://github.com/apache/airflow/issues/32420#issuecomment-1627473043

   > We cannot remove db init from doc since we are only removing the create 
connections logic into db create-default-connections but the rest of the logic
   
   As commented in 
https://github.com/apache/airflow/issues/32048#issuecomment-1627456200 - we 
could hide/deprecate "init" and create a new command ("intiialize") and doument 
it's behaviour (and change it in the way that it will **only** work on an empty 
database and fails (and recommends to use upgrade) if it is non-empty. 
   
   Side (but related) comment.
   
   There is one problem with two separate `init` (even if we rename it to 
`initialize`) and `upgrade` command. While it is "logical" to have those two 
commands, in fact it is rather difficult to use in "automated" cases - for 
example in our Helm Chart we never use init - always upgrade. This is very 
clear example where we want a command that will achieve the "target" state, no 
matter what initial stage is (in this case `upgrade` works in the way that it 
achieves the "target" state of database in the "current" version - no matter 
what the initial state was. 
   
   This case is well known and it's a great property of such commands - and 
this is the whole reason why Terraform exists. This is the whole promise of 
Terraform, that all the terraform providers work this way: you describe the 
target state you want to achieve and Terraforms figures out how to get there.
   
   In this sense, I think maybe we should just forget the "init" or 
"initialize" - and keep only one command (current upgrade) that could manage 
the state of the database? Maybe it should not even be named "upgrade" ? Maybe 
it should be `airflow db sync`  for example?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to