Raise exception if links tables already exists
This commit is contained in:
parent
3035b138f9
commit
9e5bb54eab
|
@ -16,7 +16,7 @@ cur = con.cursor()
|
|||
# test if table already exists
|
||||
cur.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='links'")
|
||||
if cur.fetchone():
|
||||
print('Links table already exists.')
|
||||
raise Exception('Links table already exists.')
|
||||
else:
|
||||
cur.execute('''CREATE TABLE links (
|
||||
url text NOT NULL,
|
||||
|
|
Loading…
Reference in New Issue