Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timestamp columns to most tables #122

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions database.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ def createObsTables(self):
source_url TINYTEXT, /* URL where confirming data can be found */
notes TINYTEXT, /* TruSat team processing notes */
opt_out TINYINT(1) DEFAULT NULL, /* Flag to prevent processing of data from disinterested stations */
creation_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, /* Timestamp of record creation */
UNIQUE KEY Station_station_num_idx (station_num) USING BTREE,
KEY Station_user_idx (user) USING BTREE,
KEY Station_user_station_idx (user, station_num),
Expand Down Expand Up @@ -722,6 +723,7 @@ def createObsTables(self):
bio TEXT, /* User-specified (publicly visible) bio */
url_profile TEXT, /* Profile URL - notionally gravitar or similar. FIXME: need to protect for exploits */
url_image TEXT, /* Profile Image URL - notionally gravitar or similar. FIXME: need to protect for exploits */
creation_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, /* Timestamp of record creation */
KEY `Observer_id_idx` (`id`) USING BTREE,
KEY `Observer_eth_addr_idx` (`eth_addr`) USING BTREE,
KEY `Observer_reputation_idx` (`reputation`) USING BTREE
Expand All @@ -739,6 +741,7 @@ def createObsTables(self):
`email` TEXT DEFAULT NULL, /* Email Associated with Observer */
`primary` INT(11) DEFAULT NULL, /* Order to use Emails */
`notes` TEXT DEFAULT NULL, /* Internal Notes */
`creation_timestamp` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, /* Timestamp of record creation */
KEY `Observer_email_User_num_idx` (`user_id`) USING BTREE
)''' + self.charset_string
self.c.execute(createquery)
Expand Down