-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename db init
to db create-default-connections
#32420
Comments
I can take this up! |
Just a note - we should also keep the 'db init` working but raising a deprecation warnings (but it should not be documented). This is something we've done in the past (I recall we have a mechanism for that). Once we do this rename, we can consider also next step (this is where the whole discussion started with @eladkal) to indeed move the connection definition to providers. Basically that should be a new information exposed by get_provider_info - "default_connection" dictionary and exposed by Provider Manager. This is a little more complex though. We need think how to make sure backwards compatibility (and what it really means) with older providers which do not expose this information, so I'd say this should be done as follow up and some discussion over a PR. |
Sure @potiuk noted! |
We cannot remove
will still be there in |
As commented in #32048 (comment) - 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 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 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 |
Hmm, so its better to work towards the final target, i.e, to create And keep, creation of default connections (of installed providers in separate PR, maybe) in a separate command i.e |
I'd keep the "default connections" out of the "sync" scope. The "structure" of the db can be synced rather easily, but syncing DB rows is a much more complex subject and there are many edge cases, and I think this should be an explicit, separate command to create those. At least that's the guts feeling I have. |
Let's see what others think of it. cc - @eladkal @utkarsharma2 @hussein-awala (from #32048) |
Body
As discussed in #32048 the
airflow db init
is very confusing to users.The goal of this task is to rename this command so it will be more self explained.
The task:
airflow db init
toairflow db create-default-connections
airflow db init
Committer
The text was updated successfully, but these errors were encountered: