File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 :
You can’t perform that action at this time.
0 commit comments