forked from yoyonel/audio-fingerprint-identifying-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreset-database.py
More file actions
38 lines (30 loc) · 721 Bytes
/
reset-database.py
File metadata and controls
38 lines (30 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python
from libs.db_sqlite import SqliteDatabase
if __name__ == '__main__':
db = SqliteDatabase()
#
# songs table
db.query("DROP TABLE IF EXISTS songs;")
print('removed db.songs');
db.query("""
CREATE TABLE songs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
filehash TEXT
);
""")
print('created db.songs');
#
# fingerprints table
db.query("DROP TABLE IF EXISTS fingerprints;")
print('removed db.fingerprints');
db.query("""
CREATE TABLE `fingerprints` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`song_fk` INTEGER,
`hash` TEXT,
`offset` INTEGER
);
""")
print('created db.fingerprints');
print('done');