Untitled
unknown
plain_text
a year ago
1.3 kB
2
Indexable
Never
# check for table schedule_of_charges if not "schedule_of_charges" in table_n: cursor.execute(""" CREATE TABLE schedule_of_charges( serial_id SERIAL PRIMARY KEY, hospital_id text not null, document text not null, page text not null, table_number integer not null, s3url text not null, service_code text, category text, subcategory text, service_description text not null, bounding_box text not null default '[]', type_of_room text not null default 'tariff', price_per_unit text not null, remarks text, los text, inclusions text, exclusions text, start_date text not null, end_date text not null default '2099-12-31', tariff_type text not null, room_mapping text, confidence_score text, standard_term text )""") conn.commit() print("Tables created schedule_of_charges") else: print("Table Exists") conn.close() def drop_table(): conn = psycopg2.connect( database=DATABASE, user=USER, password=PASSWORD, host=HOST, port=PORT ) cursor = conn.cursor() sql = '''DROP TABLE schedule_of_charges ''' cursor.execute(sql) print("Table dropped !") conn.commit() conn.close() # drop_table()