diff --git a/.gitignore b/.gitignore index f5e96db..9069f18 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -venv \ No newline at end of file +venv +links.db \ No newline at end of file diff --git a/backend/setup_db.py b/backend/setup_db.py new file mode 100644 index 0000000..6f5590b --- /dev/null +++ b/backend/setup_db.py @@ -0,0 +1,19 @@ +import sqlite3 +con = sqlite3.connect('links.db') + +# array of links to store +links = [ + ('http://csclub.uwaterloo.ca/','CS Club Website',3,1), + ('https://www.instagram.com/uwcsclub/','Instagram',4,1), + ('https://www.facebook.com/uw.computerscienceclub','Facebook',5,0), + ('http://twitch.tv/uwcsclub','Twitch',6,0), + ('http://bit.ly/uwcsclub-yt','YouTube',7,1), +] + +# SQLite setup +cur = con.cursor() +cur.execute("CREATE TABLE links (url text, name text, clicks int, active int)") +cur.executemany("INSERT INTO links VALUES (?,?,?,?)", links) +con.commit() + +con.close() \ No newline at end of file