diff --git a/.gitignore b/.gitignore index c0a06d9..f22766e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .env .venv sec_data/ -CIK* \ No newline at end of file +CIK* +.vscode \ No newline at end of file diff --git a/db_schema.sql b/db_schema.sql index 30e0484..a5836b9 100644 --- a/db_schema.sql +++ b/db_schema.sql @@ -1,11 +1,11 @@ CREATE TABLE entities ( cik INT PRIMARY KEY, -- CIK is now the primary key, ensuring uniqueness - entityName VARCHAR(255) NOT NULL -- Name of the company + name VARCHAR(255) NOT NULL -- Name of the company ); CREATE TABLE facts ( + id VARCHAR(255) PRIMARY KEY, -- Unique identifier for the fact taxonomy VARCHAR(255), -- Taxonomy of the fact - fact VARCHAR(255) PRIMARY KEY, -- Label of the fact label VARCHAR(255), -- Label of the fact description TEXT, -- Description of the fact unit VARCHAR(255), -- Unit of the fact @@ -13,7 +13,7 @@ CREATE TABLE facts ( CREATE TABLE data ( cik INT, -- CIK of the company - fact VARCHAR(255), + fact_id VARCHAR(255), start DATE, -- Start date of the fact end DATE, val INT, @@ -25,5 +25,5 @@ CREATE TABLE data ( frame VARCHAR(255), PRIMARY KEY (cik, label) FOREIGN KEY (cik) REFERENCES entities(cik), - FOREIGN KEY (fact) REFERENCES facts(fact) + FOREIGN KEY (fact_id) REFERENCES facts(id) );