malo čiščenja kode in robustnostni popravek (kreiranje prazne sheme)
This commit is contained in:
15
db_schema.py
Normal file
15
db_schema.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import sqlite3
|
||||
|
||||
def create_tables(conn):
|
||||
"""
|
||||
Ustvari potrebne tabele v bazi, če še ne obstajajo.
|
||||
"""
|
||||
cursor = conn.cursor()
|
||||
cursor.execute('''
|
||||
CREATE TABLE IF NOT EXISTS songs (
|
||||
id INTEGER PRIMARY KEY,
|
||||
title TEXT,
|
||||
lyrics TEXT
|
||||
)
|
||||
''')
|
||||
conn.commit()
|
||||
Reference in New Issue
Block a user