sc3 / cookcountyjail

A Django app that tracks the population of Cook County Jail over time and summarizes trends.
http://cookcountyjail.recoveredfactory.net/api/1.0/?format=json
Other
31 stars 23 forks source link

Clean up db columns #366

Open wilbertom opened 10 years ago

wilbertom commented 10 years ago

Set lengths on Unicode columns, make sure all columns which can't be null, can't be null. Replace SQLite3 and apply the database migration.

wilbertom commented 10 years ago

Paging @nwinklareth @bepetersn, what is a ChargesDescription's description column? Is it what we called a charges

nwinklareth commented 10 years ago

"Driving with a suspended license"

That is an example of a description.

As to the length, run this query on the database:

select charges from countyapi_chargeshistory where length(charges ) = ( select max(length(charges )) from countyapi_chargeshistory)

then sun up to the next power of 2 and use that as the length of field, I would use varchar or the unicode equivalent, fixed length field will waste a lot of space

On Mon, May 12, 2014 at 5:36 PM, Wilberto Morales notifications@github.comwrote:

Paging @nwinklareth https://github.com/nwinklareth @bepetersnhttps://github.com/bepetersn, what is a ChargesDescription's description column?

— Reply to this email directly or view it on GitHubhttps://github.com/sc3/cookcountyjail/issues/366#issuecomment-42897333 .

Regards

Norbert

Norbert Winklareth

bepetersn commented 10 years ago

@wilbertom, does this still need work?

wilbertom commented 10 years ago

Yup still needs a lot with columns sizes, and stuff.