Skip to content

Commit

Permalink
Fixed SQL syntax errors when creating a new DB
Browse files Browse the repository at this point in the history
  • Loading branch information
npalacioescat committed Jun 4, 2024
1 parent ea0f923 commit 2c71d61
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cache_manager/_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _create_schema(self):

_log(f'Initializing database')

fields = ','.join(f'{k}: {v}' for k, v in self._table_fields().items())
fields = ', '.join(f'{k} {v}' for k, v in self._table_fields().items())

_log(f'Ensuring main table exists')
self._execute(f'''
Expand All @@ -98,9 +98,10 @@ def _create_schema(self):
'''
CREATE TABLE IF NOT EXISTS
attr_{} (
id VARCHAR FOREIGN KEY,
id INT,
name VARCHAR,
value {}
value {},
FOREIGN KEY(id) REFERENCES main(id)
)
'''.format(typ, typ.upper()),
)
Expand Down

0 comments on commit 2c71d61

Please sign in to comment.