jaimeyu / travvik-www

I wrote a PHP application that serves OC Transpo's live data in a more comfortable way. Data can be served in JSON format or as a webpage.
MIT License
1 stars 1 forks source link

Add database layout to github #9

Closed jaimeyu closed 10 years ago

jaimeyu commented 10 years ago

Maybe an php based db creator? Documentation through code and it simplifies deployment.

Right now, there is little to no documentation and this could be improved.

john-- commented 10 years ago

I'm looking to test this out locally. Is the DB schema anywhere? Even a MySQL dump would be good enough for now (you can select "schema only" during a dump).

jaimeyu commented 10 years ago

Hey,

It seems I didn't upload the php that was the closest to a schema.

I will pull it out later and push it up to the repo. Its nothing complicated. You can try it out without the mysql stuff as well. Mysql is only for the cache and GPS location of every bus stop in Ottawa. If you are in a hurry, I would go this route first. (An old working copy of octapi without sql can be found at https://github.com/jaimeyu/octranspojson/blob/master/octapi.php)

Was a pain in the butt to upload and I'm planning to pull it out so I can reuse it for another project. I think there is some worth adding it to the repo as well.

Sincerely, Jaime Yu B.Eng in Computer Engineering, System Hardware Kernel Software Engineer at Juniper Networks

$CV = "http://cv.jaimeyu.com" $Blog = "http://ask.jaimeyu.com" $Project = "http://www.capstone490.com" $Linkedin = https://www.linkedin.com/in/jaimeyu $GitHub = https://github.com/jaimeyu

On Mar 12, 2014 3:24 PM, "john--" notifications@github.com wrote:

I'm looking to test this out locally. Is the DB schema anywhere? Even a MySQL dump would be good enough for now (you can select "schema only" during a dump).

— Reply to this email directly or view it on GitHubhttps://github.com/jaimeyu/travvik-www/issues/9#issuecomment-37452620 .

jaimeyu commented 10 years ago

Just uploaded the db to the repo. Layouts:

STOPS: Field Type Null Key Default Extra stop_id varchar(255) NO PRI NULL
stop_code int(10) unsigned NO NULL
stop_name varchar(255) NO NULL
stop_desc varchar(255) NO NULL
stop_lat double NO NULL
stop_lon double

STOP_CACHE: Field Type Null Key Default Extra stop_code int(10) NO PRI NULL
data text NO NULL
timestamp timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP

TIME_CACHE: Field Type Null Key Default Extra routestop varchar(255) NO PRI NULL
data text NO NULL
timestamp timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP

john-- commented 10 years ago

Thanks! I'm going to check it out.

john-- commented 10 years ago

Works great. Ran into a few small things that I fixed up for my local environment. Submitted a pull request for them.

jaimeyu commented 10 years ago

Thanks. I thought I had fixed the credential path problem... I better check if I forgot to push it...

What is the effect of suppressing errors on those methods? I'm not a fan of suppressing them and would rather fix them (no doubt there are problems).

jaimeyu commented 10 years ago

Please see document: https://github.com/jaimeyu/travvik-www/wiki/SQL-Schema Also uploaded a copy of the db to db/. Closing issue until the schema becomes out of date.