fix: remove not null in some places

This commit is contained in:
Leonard Excoffier
2024-08-31 18:26:54 -04:00
parent 84b20e1496
commit 3f5f6d5569

View File

@@ -3,12 +3,12 @@
-- Create SUB table -- Create SUB table
CREATE TABLE sub ( CREATE TABLE sub (
adsh CHAR(20) PRIMARY KEY NOT NULL, -- Accession number, primary key adsh CHAR(20) PRIMARY KEY NOT NULL, -- Accession number, primary key
cik BIGINT NOT NULL, -- Central Index Key (CIK) cik BIGINT , -- Central Index Key (CIK)
name VARCHAR(150) NOT NULL, -- Name of registrant name VARCHAR(150) , -- Name of registrant
sic INTEGER, -- Standard Industrial Classification (SIC) sic INTEGER, -- Standard Industrial Classification (SIC)
countryba CHAR(2) NOT NULL, -- Country of business address (ISO 3166-1) countryba CHAR(2) , -- Country of business address (ISO 3166-1)
stprba CHAR(2), -- State/Province of business address (if applicable) stprba CHAR(2), -- State/Province of business address (if applicable)
cityba VARCHAR(30) NOT NULL, -- City of business address cityba VARCHAR(30) , -- City of business address
zipba VARCHAR(10), -- Zip code of business address zipba VARCHAR(10), -- Zip code of business address
bas1 VARCHAR(40), -- First line of business address bas1 VARCHAR(40), -- First line of business address
bas2 VARCHAR(40), -- Second line of business address bas2 VARCHAR(40), -- Second line of business address
@@ -25,18 +25,18 @@ CREATE TABLE sub (
former VARCHAR(150), -- Most recent former name former VARCHAR(150), -- Most recent former name
changed CHAR(8), -- Date of change from former name changed CHAR(8), -- Date of change from former name
afs CHAR(5), -- Filer Status with SEC afs CHAR(5), -- Filer Status with SEC
wksi BOOLEAN NOT NULL, -- Well Known Seasoned Issuer (WKSI) wksi BOOLEAN , -- Well Known Seasoned Issuer (WKSI)
fye CHAR(4) NOT NULL, -- Fiscal Year End Date (format: mmdd) fye CHAR(4) , -- Fiscal Year End Date (format: mmdd)
form VARCHAR(10) NOT NULL, -- Submission type (Form) form VARCHAR(10) , -- Submission type (Form)
period CHAR(8) NOT NULL, -- Balance Sheet Date (format: yyyymmdd) period CHAR(8) , -- Balance Sheet Date (format: yyyymmdd)
fy INTEGER NOT NULL, -- Fiscal Year focus (Year) fy INTEGER , -- Fiscal Year focus (Year)
fp CHAR(2) NOT NULL, -- Fiscal Period focus (e.g., FY, Q1) fp CHAR(2) , -- Fiscal Period focus (e.g., FY, Q1)
filed CHAR(8) NOT NULL, -- Date of filing (format: yyyymmdd) filed CHAR(8) , -- Date of filing (format: yyyymmdd)
accepted TIMESTAMP NOT NULL, -- Acceptance date and time by SEC accepted TIMESTAMP , -- Acceptance date and time by SEC
prevrpt BOOLEAN NOT NULL, -- Indicates if the submission was amended prevrpt BOOLEAN , -- Indicates if the submission was amended
detail BOOLEAN NOT NULL, -- Indicates detail in footnotes and schedules detail BOOLEAN , -- Indicates detail in footnotes and schedules
instance VARCHAR(32) NOT NULL, -- Name of submitted XBRL Instance Document instance VARCHAR(32) , -- Name of submitted XBRL Instance Document
nciks INTEGER NOT NULL, -- Number of CIKs included in submission nciks INTEGER , -- Number of CIKs included in submission
aciks VARCHAR(120) -- Additional CIKs included in submission aciks VARCHAR(120) -- Additional CIKs included in submission
); );
@@ -44,8 +44,8 @@ CREATE TABLE sub (
CREATE TABLE tag ( CREATE TABLE tag (
tag VARCHAR(256) NOT NULL, -- Unique identifier for a tag tag VARCHAR(256) NOT NULL, -- Unique identifier for a tag
version CHAR(20) NOT NULL, -- Taxonomy version if standard, else adsh version CHAR(20) NOT NULL, -- Taxonomy version if standard, else adsh
custom BOOLEAN NOT NULL, -- 1 if custom tag, 0 if standard tag custom BOOLEAN , -- 1 if custom tag, 0 if standard tag
abstract BOOLEAN NOT NULL, -- 1 if abstract (not numeric), 0 if numeric abstract BOOLEAN , -- 1 if abstract (not numeric), 0 if numeric
datatype VARCHAR(20), -- Data type (if numeric) datatype VARCHAR(20), -- Data type (if numeric)
iord CHAR(1), -- "I" for point-in-time, "D" for duration iord CHAR(1), -- "I" for point-in-time, "D" for duration
crdr CHAR(1), -- Credit/ Debit nature, if monetary crdr CHAR(1), -- Credit/ Debit nature, if monetary
@@ -77,12 +77,12 @@ CREATE TABLE pre (
adsh CHAR(20) NOT NULL, -- Accession number adsh CHAR(20) NOT NULL, -- Accession number
report INTEGER NOT NULL, -- Sequence number of report report INTEGER NOT NULL, -- Sequence number of report
line INTEGER NOT NULL, -- Sequence number of line in the report line INTEGER NOT NULL, -- Sequence number of line in the report
stmt CHAR(2) NOT NULL, -- Statement type (BS, IS, CF, EQ, CI, etc.) stmt CHAR(2) , -- Statement type (BS, IS, CF, EQ, CI, etc.)
inpth BOOLEAN NOT NULL, -- Presented parenthetically or not inpth BOOLEAN , -- Presented parenthetically or not
rfile CHAR(1) NOT NULL, -- File type ("H" or "X") rfile CHAR(1) , -- File type ("H" or "X")
tag VARCHAR(256) NOT NULL, -- Tag name tag VARCHAR(256) NOT NULL, -- Tag name
version CHAR(20) NOT NULL, -- Taxonomy version version CHAR(20) NOT NULL, -- Taxonomy version
plabel VARCHAR(512) NOT NULL, -- Preferred label for presentation plabel VARCHAR(512) , -- Preferred label for presentation
PRIMARY KEY (adsh, report, line), PRIMARY KEY (adsh, report, line),
FOREIGN KEY (adsh) REFERENCES sub(adsh), FOREIGN KEY (adsh) REFERENCES sub(adsh),