-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch from upper case to lower case for mysql tables/columns
- Loading branch information
Showing
3 changed files
with
124 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,65 @@ | ||
CREATE TABLE PROCESSING ( | ||
PROCESSING_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
PROCESSING VARCHAR(255) NOT NULL UNIQUE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
CREATE TABLE processing ( | ||
processing_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
processing VARCHAR(255) NOT NULL UNIQUE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); | ||
CREATE TABLE PARENTS ( | ||
PARENT_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
PARENT VARCHAR(255) NOT NULL UNIQUE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
CREATE TABLE parents ( | ||
parent_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
parent VARCHAR(255) NOT NULL UNIQUE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); | ||
CREATE TABLE SITES ( | ||
SITE_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
SITE VARCHAR(255) NOT NULL UNIQUE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
CREATE TABLE site ( | ||
site_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
site VARCHAR(255) NOT NULL UNIQUE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); | ||
CREATE TABLE BUCKETS ( | ||
BUCKET_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
BUCKET VARCHAR(255) NOT NULL UNIQUE, | ||
META_ID VARCHAR(255), | ||
DATASET_ID BIGINT REFERENCES DATASETS(DATASET_ID) ON UPDATE CASCADE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
CREATE TABLE buckets ( | ||
bucket_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
bucket VARCHAR(255) NOT NULL UNIQUE, | ||
meta_id VARCHAR(255), | ||
dataset_id BIGINT REFERENCES datasets(dataset_id) ON UPDATE CASCADE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); | ||
CREATE TABLE METADATA ( | ||
META_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
DID VARCHAR(255) NOT NULL UNIQUE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
CREATE TABLE metadata ( | ||
meta_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
did VARCHAR(255) NOT NULL UNIQUE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); | ||
CREATE TABLE DATASETS ( | ||
DATASET_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
DATASET VARCHAR(255) NOT NULL UNIQUE, | ||
META_ID BIGINT REFERENCES METADATA(META_ID) ON UPDATE CASCADE, | ||
SITE_ID BIGINT REFERENCES SITES(SITE_ID) ON UPDATE CASCADE, | ||
PROCESSING_ID BIGINT REFERENCES PROCESSINGS(PROCESSING_ID) ON UPDATE CASCADE, | ||
PARENT_ID BIGINT REFERENCES PARENTS(PARENT_ID) ON UPDATE CASCADE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
CREATE TABLE datasets ( | ||
dataset_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
dataset VARCHAR(255) NOT NULL UNIQUE, | ||
meta_id BIGINT REFERENCES metadata(meta_id) ON UPDATE CASCADE, | ||
site_id BIGINT REFERENCES site(site_id) ON UPDATE CASCADE, | ||
processing_id BIGINT REFERENCES processingS(processing_id) ON UPDATE CASCADE, | ||
parent_id BIGINT REFERENCES parents(parent_id) ON UPDATE CASCADE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); | ||
CREATE TABLE FILES ( | ||
FILE_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
FILE VARCHAR(255) NOT NULL UNIQUE, | ||
IS_FILE_VALID INTEGER DEFAULT 1, | ||
META_ID BIGINT REFERENCES METADATA(META_ID) ON UPDATE CASCADE, | ||
DATASET_ID BIGINT REFERENCES DATASETS(DATASET_ID) ON UPDATE CASCADE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
CREATE TABLE files ( | ||
file_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
file VARCHAR(255) NOT NULL UNIQUE, | ||
is_file_valid INTEGER DEFAULT 1, | ||
meta_id BIGINT REFERENCES metadata(meta_id) ON UPDATE CASCADE, | ||
dataset_id BIGINT REFERENCES datasets(dataset_id) ON UPDATE CASCADE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,67 @@ | ||
--https://stackoverflow.com/questions/18387209/sqlite-syntax-for-creating-table-with-foreign-key | ||
|
||
CREATE TABLE PROCESSING ( | ||
PROCESSING_ID INTEGER PRIMARY KEY AUTOINCREMENT, | ||
PROCESSING VARCHAR(255) NOT NULL UNIQUE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
create TABLE processing ( | ||
processing_id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
processing VARCHAR(255) NOT NULL UNIQUE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); | ||
CREATE TABLE PARENTS ( | ||
PARENT_ID INTEGER PRIMARY KEY AUTOINCREMENT, | ||
PARENT VARCHAR(255) NOT NULL UNIQUE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
create TABLE parents ( | ||
parent_id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
parent VARCHAR(255) NOT NULL UNIQUE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); | ||
CREATE TABLE SITES ( | ||
SITE_ID INTEGER PRIMARY KEY AUTOINCREMENT, | ||
SITE VARCHAR(255) NOT NULL UNIQUE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
create TABLE sites ( | ||
site_id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
site VARCHAR(255) NOT NULL UNIQUE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); | ||
CREATE TABLE BUCKETS ( | ||
BUCKET_ID INTEGER PRIMARY KEY AUTOINCREMENT, | ||
BUCKET VARCHAR(255) NOT NULL UNIQUE, | ||
META_ID VARCHAR(255), | ||
DATASET_ID INTEGER REFERENCES DATASETS(DATASET_ID) ON UPDATE CASCADE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
create TABLE buckets ( | ||
bucket_id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
bucket VARCHAR(255) NOT NULL UNIQUE, | ||
meta_id VARCHAR(255), | ||
dataset_id INTEGER REFERENCES datasets(dataset_id) ON UPDATE CASCADE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); | ||
CREATE TABLE METADATA ( | ||
META_ID INTEGER PRIMARY KEY AUTOINCREMENT, | ||
DID VARCHAR(255) NOT NULL UNIQUE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
create TABLE metadata ( | ||
meta_id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
did VARCHAR(255) NOT NULL UNIQUE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); | ||
CREATE TABLE DATASETS ( | ||
DATASET_ID INTEGER PRIMARY KEY AUTOINCREMENT, | ||
DATASET VARCHAR(255) NOT NULL UNIQUE, | ||
META_ID INTEGER REFERENCES METADATA(META_ID) ON UPDATE CASCADE, | ||
SITE_ID INTEGER REFERENCES SITES(SITE_ID) ON UPDATE CASCADE, | ||
PROCESSING_ID INTEGER REFERENCES PROCESSINGS(PROCESSING_ID) ON UPDATE CASCADE, | ||
PARENT_ID INTEGER REFERENCES PARENTS(PARENT_ID) ON UPDATE CASCADE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
create TABLE datasets ( | ||
dataset_id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
dataset VARCHAR(255) NOT NULL UNIQUE, | ||
meta_id INTEGER REFERENCES metadata(meta_id) ON UPDATE CASCADE, | ||
site_id INTEGER REFERENCES sites(site_id) ON UPDATE CASCADE, | ||
processing_id INTEGER REFERENCES processingS(processing_id) ON UPDATE CASCADE, | ||
parent_id INTEGER REFERENCES parents(parent_id) ON UPDATE CASCADE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); | ||
CREATE TABLE FILES ( | ||
FILE_ID INTEGER PRIMARY KEY AUTOINCREMENT, | ||
FILE VARCHAR(255) NOT NULL UNIQUE, | ||
IS_FILE_VALID INTEGER DEFAULT 1, | ||
META_ID INTEGER REFERENCES METADATA(META_ID) ON UPDATE CASCADE, | ||
DATASET_ID INTEGER REFERENCES DATASETS(DATASET_ID) ON UPDATE CASCADE, | ||
CREATE_AT INTEGER, | ||
CREATE_BY VARCHAR(255), | ||
MODIFY_AT INTEGER, | ||
MODIFY_BY VARCHAR(255) | ||
create TABLE files ( | ||
file_id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
file VARCHAR(255) NOT NULL UNIQUE, | ||
is_file_valid INTEGER DEFAULT 1, | ||
meta_id INTEGER REFERENCES metadata(meta_id) ON UPDATE CASCADE, | ||
dataset_id INTEGER REFERENCES datasets(dataset_id) ON UPDATE CASCADE, | ||
create_at INTEGER, | ||
create_by VARCHAR(255), | ||
modify_at INTEGER, | ||
modify_by VARCHAR(255) | ||
); |