shift-org / shift-org/shift-docs
Table reorg prosposal
@ionous is already working on this.
Since Oct 26, 2025.
- Dominant language
- JavaScript
- Stars
- 30
- Forks
- 25
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description
My main goal after node optimizations is to support event tags ( ex. "protest ride" ); i started pondering.... and the idea grew a bit. 😊 I went through existing issues on db data, and put together some ideas for a table reorg:
SERIES:
The core ride data. ( similar to calevent; but many fewer columns. )
idauto assigned integer: The ride and all of its related info binds to this id. ( duplicates the existingcalevent.id)createdtime: The date and time the ride was first added to the db. ( TODO: verify migrated data has a decent creation/modified time.modifiedtime: The date and time of the most recent change to the ride data. ( TODO: verify this is working as expected )publishedinteger: Non-zero when visible to the world,nullmeans revoked/unpublished. Increments every time the ride data gets updated. ( basically, merges 'hidden' and 'change_counter'. If the current data has a null or blankpassword, then published would be null; otherwise it'd be the opposite of hidden )titlestring: human readable name of the ride.tinytitlesmall text: optional shorter title.organizerstring: Name of the person or group who authored the ride ( replacesname)start_timestring: local time as HH:DD. IMPORTANT: this isn't a mysql timestamp! if an organizer on the east coast says "ride starts at 8AM" we can look in the db expect to see "08:00" regardless of their time zone, our time zone, or the server's timezone. ( replaces eventtime )ride_durationinteger: time in minutes. ( replaces eventduration )detailslarge text: contains a complete description of the ride. ( replacesdescr )
SCHEDULE:
A specific outing of a specific ride series. These are uniquely identified by the combination of its series and day ( the id and ymd fields, respectively. )
idref: Multiple scheduled days can exist for a single ride series.ymdstring: Day that the ride takes place in YYYY-MM-DD format.newsstring, replacesnewsflashstatussmall integer: can be 1, 0, or null. 1 is active, 0 is cancelled, null is delisted. ( replaceseventstatus. )pkidauto assigned integer: deprecated. exists for backwards compatibility.
PRIVATE:
Holds any and all data that requires explicit permission to display. Rationale: by putting all private data in its own table, we can easily export anonymized data ( by simply excluding this table. )
idref: Exactly one private row exists for every ride series.secretstring: user password.show_emailbool: Does the organizer want to share their private_email address?show_phonebool: Does the organizer want to share their private_phone number?show_contactbool: Does the organizer want to share their private_contact info?private_emailstring: The organizer's email.private_phonestring: The organizer's phone number.private_contactstring: Any arbitrary information the organizer would like to share about themselves.
LOCATION:
Provides extended data about the start and end of a ride.
idref: One or more locations exist for a given ride. For example, all rides have a start, and many have an end. )loc_typestring: 'start' or 'finish' ( replaceseventtime)place_namestring: arbitrary name for the location.addressstring: human readable address of the location.place_infostring: extra info provided by the organizer. ( replaceslocdetails)time_infostring: extra info provided by the organizer. ( replacestimedetails)
PRINT:
Used for the print calendar.
idref: At most one print row exists for every ride series.printed_summarylarge text: ( was printdescr )add_emailbool: includes the private email on the print calendar.add_phonebool: includes the private email address on the print calendar.add_contactbool: includes private contact info on the print calendar.add_linkbool: includes the public web link on the print calendar.
WEB:
Includes any off site links to websites or social accounts. ( Replaces 'weburl' and 'webname' )
idref: An arbitrary number of web entries can exist for a given ride series; although, currently we only support one. ( for website "url" )web_typestring: ex. "url", could be "bluesky", or whatever.web_textstring: A description of the link provided by the organizer.web_linkstring: ex. "https://example.come"
TAG:
idref: An arbitrary number of tags can exist for a given ride series.tag_namestring: some examples below.tag_valuestring, or the string "true".
Maybe someday tags could be added directly by users. For now, these would be our built-in tags:
- audience: "General", "Family", "Adult"
- area: ex. "Portland", "Vancouver", etc.
- safety: the string "true", or doesn't exist and isn't covid friendly.
- featured: the string "true", some extra details, or doesn't exist and isn't featured.
- loop: the string "true", or doesn't exist and isn't a loop.
- distance: one of the exiting strings: "0-3", ..., "15+"
Maybe:
- pace ex. easy, steady, strenuous, etc.
no drop? - protest: "true", or doesn't exist and isn't a protest ride.
IMAGE:
for any rides with images; rationale: not all rides have images;
idref: At most one image can exist per ride series.img_versionint: Exists for cache-busting. Incremented whenever a new image is uploaded.img_extshort string: The original file extension, lowercased.img_overridestring: For images that we maintainers have manually set to a specific file; used very rarely. Typically the image filename is theid.extand this override string is blank.img_altstring: future idea. Organizer specified alt text for the image.
Time Handling
The SERIES start_time and the SCHEDULE days are stored as strings, HH:DD and YYYY-MM-DD respectively. They are measured relative to organizer's time zone, not the server's time zone, nor utc. This is intended to avoid questions around the SCHEDULE(d) day of an east coast ride starting at 11:59 PM when stored on a west coast server.
Database created and modified times, however, are stored as TIMESTAMP(s) and are from the perspective of the server.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.