Closes #171 - changes datetime formats in sql server DDL to datetime2

This commit is contained in:
clairblacketer 2018-05-11 15:03:53 -04:00
parent 35cc09de77
commit c6606bf8d4
1 changed files with 19 additions and 19 deletions

View File

@ -210,7 +210,7 @@ CREATE TABLE metadata
value_as_string VARCHAR(MAX) NULL , value_as_string VARCHAR(MAX) NULL ,
value_as_concept_id INTEGER NULL , value_as_concept_id INTEGER NULL ,
metadata_date DATE NULL , metadata_date DATE NULL ,
metadata_datetime DATETIME NULL metadata_datetime DATETIME2 NULL
) )
; ;
@ -229,7 +229,7 @@ CREATE TABLE person
year_of_birth INTEGER NOT NULL , year_of_birth INTEGER NOT NULL ,
month_of_birth INTEGER NULL, month_of_birth INTEGER NULL,
day_of_birth INTEGER NULL, day_of_birth INTEGER NULL,
birth_datetime DATETIME NULL, birth_datetime DATETIME2 NULL,
race_concept_id INTEGER NOT NULL, race_concept_id INTEGER NOT NULL,
ethnicity_concept_id INTEGER NOT NULL, ethnicity_concept_id INTEGER NOT NULL,
location_id INTEGER NULL, location_id INTEGER NULL,
@ -266,7 +266,7 @@ CREATE TABLE specimen
specimen_concept_id INTEGER NOT NULL , specimen_concept_id INTEGER NOT NULL ,
specimen_type_concept_id INTEGER NOT NULL , specimen_type_concept_id INTEGER NOT NULL ,
specimen_date DATE NOT NULL , specimen_date DATE NOT NULL ,
specimen_datetime DATETIME NULL , specimen_datetime DATETIME2 NULL ,
quantity FLOAT NULL , quantity FLOAT NULL ,
unit_concept_id INTEGER NULL , unit_concept_id INTEGER NULL ,
anatomic_site_concept_id INTEGER NULL , anatomic_site_concept_id INTEGER NULL ,
@ -285,7 +285,7 @@ CREATE TABLE death
( (
person_id INTEGER NOT NULL , person_id INTEGER NOT NULL ,
death_date DATE NOT NULL , death_date DATE NOT NULL ,
death_datetime DATETIME NULL , death_datetime DATETIME2 NULL ,
death_type_concept_id INTEGER NOT NULL , death_type_concept_id INTEGER NOT NULL ,
cause_concept_id INTEGER NULL , cause_concept_id INTEGER NULL ,
cause_source_value VARCHAR(50) NULL, cause_source_value VARCHAR(50) NULL,
@ -301,9 +301,9 @@ CREATE TABLE visit_occurrence
person_id INTEGER NOT NULL , person_id INTEGER NOT NULL ,
visit_concept_id INTEGER NOT NULL , visit_concept_id INTEGER NOT NULL ,
visit_start_date DATE NOT NULL , visit_start_date DATE NOT NULL ,
visit_start_datetime DATETIME NULL , visit_start_datetime DATETIME2 NULL ,
visit_end_date DATE NOT NULL , visit_end_date DATE NOT NULL ,
visit_end_datetime DATETIME NULL , visit_end_datetime DATETIME2 NULL ,
visit_type_concept_id INTEGER NOT NULL , visit_type_concept_id INTEGER NOT NULL ,
provider_id INTEGER NULL, provider_id INTEGER NULL,
care_site_id INTEGER NULL, care_site_id INTEGER NULL,
@ -325,9 +325,9 @@ CREATE TABLE visit_detail
person_id INTEGER NOT NULL , person_id INTEGER NOT NULL ,
visit_detail_concept_id INTEGER NOT NULL , visit_detail_concept_id INTEGER NOT NULL ,
visit_start_date DATE NOT NULL , visit_start_date DATE NOT NULL ,
visit_start_datetime DATETIME NULL , visit_start_datetime DATETIME2 NULL ,
visit_end_date DATE NOT NULL , visit_end_date DATE NOT NULL ,
visit_end_datetime DATETIME NULL , visit_end_datetime DATETIME2 NULL ,
visit_type_concept_id INTEGER NOT NULL , visit_type_concept_id INTEGER NOT NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
care_site_id INTEGER NULL , care_site_id INTEGER NULL ,
@ -351,7 +351,7 @@ CREATE TABLE procedure_occurrence
person_id INTEGER NOT NULL , person_id INTEGER NOT NULL ,
procedure_concept_id INTEGER NOT NULL , procedure_concept_id INTEGER NOT NULL ,
procedure_date DATE NOT NULL , procedure_date DATE NOT NULL ,
procedure_datetime DATETIME NULL , procedure_datetime DATETIME2 NULL ,
procedure_type_concept_id INTEGER NOT NULL , procedure_type_concept_id INTEGER NOT NULL ,
modifier_concept_id INTEGER NULL , modifier_concept_id INTEGER NULL ,
quantity INTEGER NULL , quantity INTEGER NULL ,
@ -372,9 +372,9 @@ CREATE TABLE drug_exposure
person_id INTEGER NOT NULL , person_id INTEGER NOT NULL ,
drug_concept_id INTEGER NOT NULL , drug_concept_id INTEGER NOT NULL ,
drug_exposure_start_date DATE NOT NULL , drug_exposure_start_date DATE NOT NULL ,
drug_exposure_start_datetime DATETIME NULL , drug_exposure_start_datetime DATETIME2 NULL ,
drug_exposure_end_date DATE NOT NULL , drug_exposure_end_date DATE NOT NULL ,
drug_exposure_end_datetime DATETIME NULL , drug_exposure_end_datetime DATETIME2 NULL ,
verbatim_end_date DATE NULL , verbatim_end_date DATE NULL ,
drug_type_concept_id INTEGER NOT NULL , drug_type_concept_id INTEGER NOT NULL ,
stop_reason VARCHAR(20) NULL , stop_reason VARCHAR(20) NULL ,
@ -402,9 +402,9 @@ CREATE TABLE device_exposure
person_id INTEGER NOT NULL , person_id INTEGER NOT NULL ,
device_concept_id INTEGER NOT NULL , device_concept_id INTEGER NOT NULL ,
device_exposure_start_date DATE NOT NULL , device_exposure_start_date DATE NOT NULL ,
device_exposure_start_datetime DATETIME NULL , device_exposure_start_datetime DATETIME2 NULL ,
device_exposure_end_date DATE NULL , device_exposure_end_date DATE NULL ,
device_exposure_end_datetime DATETIME NULL , device_exposure_end_datetime DATETIME2 NULL ,
device_type_concept_id INTEGER NOT NULL , device_type_concept_id INTEGER NOT NULL ,
unique_device_id VARCHAR(50) NULL , unique_device_id VARCHAR(50) NULL ,
quantity INTEGER NULL , quantity INTEGER NULL ,
@ -424,9 +424,9 @@ CREATE TABLE condition_occurrence
person_id INTEGER NOT NULL , person_id INTEGER NOT NULL ,
condition_concept_id INTEGER NOT NULL , condition_concept_id INTEGER NOT NULL ,
condition_start_date DATE NOT NULL , condition_start_date DATE NOT NULL ,
condition_start_datetime DATETIME NULL , condition_start_datetime DATETIME2 NULL ,
condition_end_date DATE NULL , condition_end_date DATE NULL ,
condition_end_datetime DATETIME NULL , condition_end_datetime DATETIME2 NULL ,
condition_type_concept_id INTEGER NOT NULL , condition_type_concept_id INTEGER NOT NULL ,
stop_reason VARCHAR(20) NULL , stop_reason VARCHAR(20) NULL ,
provider_id INTEGER NULL , provider_id INTEGER NULL ,
@ -447,7 +447,7 @@ CREATE TABLE measurement
person_id INTEGER NOT NULL , person_id INTEGER NOT NULL ,
measurement_concept_id INTEGER NOT NULL , measurement_concept_id INTEGER NOT NULL ,
measurement_date DATE NOT NULL , measurement_date DATE NOT NULL ,
measurement_datetime DATETIME NULL , measurement_datetime DATETIME2 NULL ,
measurement_time VARCHAR(10) NULL , measurement_time VARCHAR(10) NULL ,
measurement_type_concept_id INTEGER NOT NULL , measurement_type_concept_id INTEGER NOT NULL ,
operator_concept_id INTEGER NULL , operator_concept_id INTEGER NULL ,
@ -473,7 +473,7 @@ CREATE TABLE note
note_id INTEGER NOT NULL , note_id INTEGER NOT NULL ,
person_id INTEGER NOT NULL , person_id INTEGER NOT NULL ,
note_date DATE NOT NULL , note_date DATE NOT NULL ,
note_datetime DATETIME NULL , note_datetime DATETIME2 NULL ,
note_type_concept_id INTEGER NOT NULL , note_type_concept_id INTEGER NOT NULL ,
note_class_concept_id INTEGER NOT NULL , note_class_concept_id INTEGER NOT NULL ,
note_title VARCHAR(250) NULL , note_title VARCHAR(250) NULL ,
@ -501,7 +501,7 @@ CREATE TABLE note_nlp
note_nlp_source_concept_id INTEGER NULL , note_nlp_source_concept_id INTEGER NULL ,
nlp_system VARCHAR(250) NULL , nlp_system VARCHAR(250) NULL ,
nlp_date DATE NOT NULL , nlp_date DATE NOT NULL ,
nlp_datetime DATETIME NULL , nlp_datetime DATETIME2 NULL ,
term_exists VARCHAR(1) NULL , term_exists VARCHAR(1) NULL ,
term_temporal VARCHAR(50) NULL , term_temporal VARCHAR(50) NULL ,
term_modifiers VARCHAR(2000) NULL term_modifiers VARCHAR(2000) NULL
@ -516,7 +516,7 @@ CREATE TABLE observation
person_id INTEGER NOT NULL , person_id INTEGER NOT NULL ,
observation_concept_id INTEGER NOT NULL , observation_concept_id INTEGER NOT NULL ,
observation_date DATE NOT NULL , observation_date DATE NOT NULL ,
observation_datetime DATETIME NULL , observation_datetime DATETIME2 NULL ,
observation_type_concept_id INTEGER NOT NULL , observation_type_concept_id INTEGER NOT NULL ,
value_as_number FLOAT NULL , value_as_number FLOAT NULL ,
value_as_string VARCHAR(60) NULL , value_as_string VARCHAR(60) NULL ,