acoustid / mbdata

MusicBrainz SQLAlchemy Models
MIT License
97 stars 23 forks source link

ERROR: relation "art_type" already exists #58

Open Simon-Nemaura opened 1 year ago

Simon-Nemaura commented 1 year ago

The following error is displayed when running mbslave init --create-user --create-database

psql:/var/folders/63/wlxrc7ds36s2mhyddjpg56_80000gn/T/tmprzrao_gq.sql:14: ERROR:  relation "art_type" already exists
Traceback (most recent call last):
  File "/Users/simonhopkin/.local/bin/mbslave", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/simonhopkin/.local/pipx/venvs/mbdata/lib/python3.11/site-packages/mbdata/replication.py", line 803, in main
    args.func(config, args)
  File "/Users/simonhopkin/.local/pipx/venvs/mbdata/lib/python3.11/site-packages/mbdata/replication.py", line 653, in mbslave_init_main
    run_sql_script(sql_script)
  File "/Users/simonhopkin/.local/pipx/venvs/mbdata/lib/python3.11/site-packages/mbdata/replication.py", line 617, in run_sql_script
    run_script(command)
  File "/Users/simonhopkin/.local/pipx/venvs/mbdata/lib/python3.11/site-packages/mbdata/replication.py", line 609, in run_script
    subprocess.run(['bash', '-euxc', script], check=True)
  File "/usr/local/Cellar/python@3.11/3.11.1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['bash', '-euxc', 'mbslave psql -f eaa/CreateTables.sql']' returned non-zero exit status 3.

I'm using Postgresql 15 on Mac OS, Python 3.10.9

This issue only occurs when applying the following suggestion to merge into one schema:

[schemas]
musicbrainz=musicbrainz
statistics=musicbrainz
cover_art_archive=musicbrainz
wikidocs=musicbrainz
documentation=musicbrainz