Move CTAS logic into a CTAS function in db pre-upgrade (#22791)
Move CTAS logic into a CTAS function in db pre-upgrade (#22791)

Will be reusing this in later PRs that need to do the same thing, but doing in separate PR for ease of review.
cfei18/incubator-airflow,lyft/incubator-airflow,danielvdende/incubator-airflow,cfei18/incubator-airflow,apache/airflow,nathanielvarona/airflow,nathanielvarona/airflow,nathanielvarona/airflow,Acehaidrey/incubator-airflow,apache/airflow,Acehaidrey/incubator-airflow,Acehaidrey/incubator-airflow,danielvdende/incubator-airflow,Acehaidrey/incubator-airflow,Acehaidrey/incubator-airflow,lyft/incubator-airflow,apache/airflow,Acehaidrey/incubator-airflow,danielvdende/incubator-airflow,danielvdende/incubator-airflow,nathanielvarona/airflow,danielvdende/incubator-airflow,apache/airflow,nathanielvarona/airflow,apache/airflow,danielvdende/incubator-airflow,cfei18/incubator-airflow,cfei18/incubator-airflow,cfei18/incubator-airflow,nathanielvarona/airflow,cfei18/incubator-airflow,lyft/incubator-airflow,lyft/incubator-airflow,apache/airflow