AArenxiaoming commented on issue #26016: URL: https://github.com/apache/superset/issues/26016#issuecomment-1822237868
```bash psql -d superset -U superset -W # Password for user superset: ``` ```sql select database_name, password from dbs; update dbs set password = null; ``` # then you can see yourdomainaddress.com/databaseview/list/ # then add a database , somename is ok # 5 = New DB # 2 = Original DB ```sql update tables set database_id = 5 where database_id = 2; update tab_state set database_id = 5 where database_id = 2; update query set database_id = 5 where database_id = 2; update saved_query set db_id = 5 where db_id = 2; update table_schema set database_id = 5 where database_id = 2; delete from dbs where database_name = 'Original DB'; update dbs set database_name = 'Original DB' where database_name = 'New DB'; ``` # if you got this error # delete from dbs where database_name = 'Original DB'; # ERROR: update or delete on table "dbs" violates foreign key constraint "sl_datasets_database_id_fkey" on table "sl_datasets" # ERROR: update or delete on table "dbs" violates foreign key constraint "sl_tables_database_id_fkey" on table "sl_tables" # then ```sql UPDATE sl_datasets SET database_id = 5 WHERE database_id = 2; UPDATE sl_tables SET database_id = 5 WHERE database_id = 2; ``` -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
