Skip to content

Commit c0c939b

Browse files
authored
task 35, made two sql tables (evuventures#43)
* Add technical documentation to README (task 17) * added caching, used functools already built in python, and used lru cache, i tested it and it should be working, there is a test function comemnted out in main. i added some imports due to when i ran it, it wasnt finding the folders, can remove those if you want as it is probably me and my environment. * addressed comments on inital commit, creates a test file in the ./src/tests folder directory and used the unittest suite to explore the conditions when the function would return an exception, valid/invalid data. made a seperate file for cached_get,. * fixed failing build * task 35 SQL script to run in local postgres
1 parent 1aca236 commit c0c939b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

webscraper/database/init_db.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- Create users table
2+
CREATE TABLE users (
3+
id SERIAL PRIMARY KEY,
4+
username VARCHAR(255) NOT NULL UNIQUE,
5+
password_hash VARCHAR(255) NOT NULL
6+
);
7+
8+
-- Create products table
9+
CREATE TABLE products (
10+
id SERIAL PRIMARY KEY,
11+
product_name VARCHAR(255) NOT NULL,
12+
price NUMERIC(10,2) NOT NULL,
13+
url TEXT NOT NULL,
14+
user_id INTEGER NOT NULL,
15+
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
16+
);

0 commit comments

Comments
 (0)