R
Railway16mo ago
intro

Issues with Postgres DB

I don't really understand why I am not seeing any tables in my DB. Seeding works, but the database stays empty. Any idea what could fix this?
15 Replies
Percy
Percy16mo ago
Project ID: 3b4c3c14-6b11-4e8a-8f52-bb11ff2f2554
intro
introOP16mo ago
3b4c3c14-6b11-4e8a-8f52-bb11ff2f2554
Brody
Brody16mo ago
you are probably still just seeding your sqlite database
intro
introOP16mo ago
how would i know which db i am seeding
Brody
Brody16mo ago
check your local sqlite database
intro
introOP16mo ago
that looks the same
Brody
Brody16mo ago
delete it, then run the commands again, if it comes back, you are seeding your sqlite database also, i know the cli tells you to do railway up but dont
intro
introOP16mo ago
I deleted the migrations folder and the db instance folder. Deleted all pycache files from backend railway run flask db init
Creating directory /Users/hannarosenfeld/Desktop/Code/vault-manager/backend/migrations ... done
Creating directory /Users/hannarosenfeld/Desktop/Code/vault-manager/backend/migrations/versions ... done
Generating /Users/hannarosenfeld/Desktop/Code/vault-manager/backend/migrations/script.py.mako ... done
Generating /Users/hannarosenfeld/Desktop/Code/vault-manager/backend/migrations/env.py ... done
Generating /Users/hannarosenfeld/Desktop/Code/vault-manager/backend/migrations/README ... done
Generating /Users/hannarosenfeld/Desktop/Code/vault-manager/backend/migrations/alembic.ini ... done
Please edit configuration/connection/logging settings in '/Users/hannarosenfeld/Desktop/Code/vault-
manager/backend/migrations/alembic.ini' before proceeding.
Looking good? Run `railway up` to deploy your changes!
Creating directory /Users/hannarosenfeld/Desktop/Code/vault-manager/backend/migrations ... done
Creating directory /Users/hannarosenfeld/Desktop/Code/vault-manager/backend/migrations/versions ... done
Generating /Users/hannarosenfeld/Desktop/Code/vault-manager/backend/migrations/script.py.mako ... done
Generating /Users/hannarosenfeld/Desktop/Code/vault-manager/backend/migrations/env.py ... done
Generating /Users/hannarosenfeld/Desktop/Code/vault-manager/backend/migrations/README ... done
Generating /Users/hannarosenfeld/Desktop/Code/vault-manager/backend/migrations/alembic.ini ... done
Please edit configuration/connection/logging settings in '/Users/hannarosenfeld/Desktop/Code/vault-
manager/backend/migrations/alembic.ini' before proceeding.
Looking good? Run `railway up` to deploy your changes!
-- migrations folder is being created, but not database instance railway run flask db migrate
INFO [sqlalchemy.engine.Engine] select pg_catalog.version()
INFO [sqlalchemy.engine.Engine] [raw sql] {}
INFO [sqlalchemy.engine.Engine] select current_schema()
INFO [sqlalchemy.engine.Engine] [raw sql] {}
INFO [sqlalchemy.engine.Engine] show standard_conforming_strings
INFO [sqlalchemy.engine.Engine] [raw sql] {}
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [sqlalchemy.engine.Engine] BEGIN (implicit)
INFO [sqlalchemy.engine.Engine] select relname from pg_class c join pg_namespace n on n.oid=c.relnamespace where pg_catalog.pg_table_is_visible(c.oid) and relname=%(name)s
INFO [sqlalchemy.engine.Engine] [generated in 0.00032s] {'name': 'alembic_version'}
INFO [sqlalchemy.engine.Engine] SELECT alembic_version.version_num
FROM alembic_version
INFO [sqlalchemy.engine.Engine] [generated in 0.00033s] {}
INFO [sqlalchemy.engine.Engine] select relname from pg_class c join pg_namespace n on n.oid=c.relnamespace where pg_catalog.pg_table_is_visible(c.oid) and relname=%(name)s
INFO [sqlalchemy.engine.Engine] [cached since 0.3868s ago] {'name': 'alembic_version'}
INFO [sqlalchemy.engine.Engine] SELECT c.relname FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE n.nspname = %(schema)s AND c.relkind in ('r', 'p')
INFO [sqlalchemy.engine.Engine] [generated in 0.00055s] {'schema': 'public'}
INFO [alembic.autogenerate.compare] Detected added table 'vault_manager.users'
INFO [sqlalchemy.engine.Engine] COMMIT
Generating /Users/hannarosenfeld/Desktop/Code/vault-
manager/backend/migrations/versions/e90d18d95171_.py ... done
Looking good? Run `railway up` to deploy your changes!
INFO [sqlalchemy.engine.Engine] select pg_catalog.version()
INFO [sqlalchemy.engine.Engine] [raw sql] {}
INFO [sqlalchemy.engine.Engine] select current_schema()
INFO [sqlalchemy.engine.Engine] [raw sql] {}
INFO [sqlalchemy.engine.Engine] show standard_conforming_strings
INFO [sqlalchemy.engine.Engine] [raw sql] {}
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [sqlalchemy.engine.Engine] BEGIN (implicit)
INFO [sqlalchemy.engine.Engine] select relname from pg_class c join pg_namespace n on n.oid=c.relnamespace where pg_catalog.pg_table_is_visible(c.oid) and relname=%(name)s
INFO [sqlalchemy.engine.Engine] [generated in 0.00032s] {'name': 'alembic_version'}
INFO [sqlalchemy.engine.Engine] SELECT alembic_version.version_num
FROM alembic_version
INFO [sqlalchemy.engine.Engine] [generated in 0.00033s] {}
INFO [sqlalchemy.engine.Engine] select relname from pg_class c join pg_namespace n on n.oid=c.relnamespace where pg_catalog.pg_table_is_visible(c.oid) and relname=%(name)s
INFO [sqlalchemy.engine.Engine] [cached since 0.3868s ago] {'name': 'alembic_version'}
INFO [sqlalchemy.engine.Engine] SELECT c.relname FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE n.nspname = %(schema)s AND c.relkind in ('r', 'p')
INFO [sqlalchemy.engine.Engine] [generated in 0.00055s] {'schema': 'public'}
INFO [alembic.autogenerate.compare] Detected added table 'vault_manager.users'
INFO [sqlalchemy.engine.Engine] COMMIT
Generating /Users/hannarosenfeld/Desktop/Code/vault-
manager/backend/migrations/versions/e90d18d95171_.py ... done
Looking good? Run `railway up` to deploy your changes!
intro
introOP16mo ago
railway run flask db upgrade gives an error:
intro
introOP16mo ago
Postgres DB looks like this now:
Brody
Brody16mo ago
(psycopg2.errors.DuplicateTable) relation "users" already exists
please fix this error before proceeding
intro
introOP16mo ago
this is where i am stuck this error is recurring i'm gonna drop my schema and rerun all commands in hope that fixes it
Brody
Brody16mo ago
i think you should fix the problem, then your error will go away, running the same commands all day long isnt going to get you very far
intro
introOP16mo ago
i guess i don't know how to tackle this
Brody
Brody16mo ago
me neither
Want results from more Discord servers?
Add your server