generated from me/template-mit
Start on the DB tables.
1 parent
d58b40946b
commit
2b3873d458
1 file changed
+24
+24
@@ -66,7 +66,31 @@ An example is Samhein which is typically November 1.
|
||||
|
||||
## 2. Database
|
||||
|
||||
### Tables
|
||||
|
||||
#### `loc`
|
||||
|
||||
| Column Name | Type | Constraints? | Calculated? |
|
||||
| -- | - | - | --- |
|
||||
| loc_id | INT | PK,UNIQUE | |
|
||||
| zip_code | STRING | UNIQUE | |
|
||||
| lat | STRING | | |
|
||||
| long | STRING | | |
|
||||
|
||||
#### `loc_weather`
|
||||
|
||||
| Column Name | Type | Constraints? | Calculated? |
|
||||
| -- | - | - | --- |
|
||||
| loc_weather_id | INT | PK,UNIQUE | |
|
||||
| loc_id | INT | FK | |
|
||||
| weather_date | DATE | | |
|
||||
| isCurrent | | | `if weather_date >= sysdate then 'Y' else 'N' fi` |
|
||||
| isOld | | | `if weather_date < sysdate then 'Y' else 'N' fi` |
|
||||
| isExpired | | | `if weather_date < sysdate-7 then 'Y' else 'N' fi` |
|
||||
|
||||
| Extra Constraints |
|
||||
| --- |
|
||||
| UNIQUE(loc_id, weather_date) |
|
||||
|
||||
### Description
|
||||
|
||||
|
||||
Reference in new issue
Block a user