fix: Remove creation of database and db tables from env.py
This commit is contained in:
parent
ef3a382669
commit
c146de3a4d
2 changed files with 4 additions and 5 deletions
|
|
@ -87,11 +87,6 @@ db_engine = get_relational_engine()
|
||||||
|
|
||||||
print("Using database:", db_engine.db_uri)
|
print("Using database:", db_engine.db_uri)
|
||||||
|
|
||||||
if "sqlite" in db_engine.db_uri:
|
|
||||||
from cognee.infrastructure.utils.run_sync import run_sync
|
|
||||||
|
|
||||||
run_sync(db_engine.create_database())
|
|
||||||
|
|
||||||
config.set_section_option(
|
config.set_section_option(
|
||||||
config.config_ini_section,
|
config.config_ini_section,
|
||||||
"SQLALCHEMY_DATABASE_URI",
|
"SQLALCHEMY_DATABASE_URI",
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,10 @@ def upgrade() -> None:
|
||||||
dataset = _define_dataset_table()
|
dataset = _define_dataset_table()
|
||||||
user = _define_user_table()
|
user = _define_user_table()
|
||||||
|
|
||||||
|
print(insp.get_table_names())
|
||||||
|
|
||||||
|
print(_get_column(insp, "user_tenants", "tenant_id"))
|
||||||
|
|
||||||
if "user_tenants" not in insp.get_table_names():
|
if "user_tenants" not in insp.get_table_names():
|
||||||
# Define table with all necessary columns including primary key
|
# Define table with all necessary columns including primary key
|
||||||
user_tenants = op.create_table(
|
user_tenants = op.create_table(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue