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
DROP TABLE IF EXISTS time_dimension; | |
CREATE TABLE time_dimension ( | |
id INTEGER PRIMARY KEY AUTO_INCREMENT, | |
db_date DATETIME NOT NULL, | |
year INTEGER NOT NULL, | |
month INTEGER NOT NULL, -- 1 to 12 | |
day INTEGER NOT NULL, -- 1 to 31 | |
hour INTEGER NOT NULL, -- 0 to 23 | |
UNIQUE td_ymd_idx (year,month,day,hour), | |
UNIQUE td_dbdate_idx (db_date) |