Skip to content

Commit 28f6d63

Browse files
committed
remove duplicate function
1 parent 9f53325 commit 28f6d63

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

db.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,6 @@ def _get_db_connection(self):
2323
cursor_factory=DictCursor)
2424
return connection
2525

26-
def _create_tables(self):
27-
connection = self._get_db_connection()
28-
try:
29-
with connection.cursor() as cursor:
30-
cursor.execute(f"""
31-
CREATE TABLE IF NOT EXISTS activity_{self._table_suffix} (
32-
id SERIAL PRIMARY KEY,
33-
activity_type VARCHAR(50) NOT NULL,
34-
user_id VARCHAR(50) NOT NULL,
35-
station TEXT,
36-
timestamp TIMESTAMP NOT NULL
37-
)
38-
""")
39-
40-
# subscriptions table
41-
cursor.execute(f"""
42-
CREATE TABLE IF NOT EXISTS subscriptions_{self._table_suffix} (
43-
id SERIAL PRIMARY KEY,
44-
station TEXT NOT NULL,
45-
user_id VARCHAR(50) NOT NULL
46-
)
47-
""")
48-
connection.commit()
49-
except Exception as e:
50-
logger.error(f"{e} while creating tables")
51-
finally:
52-
connection.close()
53-
5426
def _create_tables(self):
5527
connection = self._get_db_connection()
5628
try:

0 commit comments

Comments
 (0)