leonarduschen commented on issue #18457: URL: https://github.com/apache/airflow/issues/18457#issuecomment-925652133
It works, thanks! But here's the thing, I was susing a managed database from DigitalOcean where the only way to change the config `sql_require_primary_key` **_permanently_** is to reach out their customer support and ask them to change it If I change it on my own like so: ```SQL SET sql_require_primary_key=OFF ``` It will reset back to ON for new connections - so there is no way to set the variable to OFF when running `airflow db init` --- So I ended up doing is: - Run `airflow db init` and let it fail - Login and run ```sql SET sql_require_primary_key=OFF; ALTER TABLE xcom DROP COLUMN id; ``` - Run `airflow db init` again It works but it feels hacky to me --- Maybe on the Airflow side, we can check if the setting is ON, and then if it is ON just set it to OFF right before we run `ALTER TABLE xcom DROP COLUMN id` - and then set it to ON again? I'd be happy to make a PR -- 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]
