Himalayan-Academy / Siva-Siva-App

Code Repository for the Siva Siva Mobile App
11 stars 3 forks source link

SQL: cached_on_disk ENUM(‘true’, ‘false’) #295

Open Brahmanathaswami opened 3 years ago

Brahmanathaswami commented 3 years ago

cached_on_disk : ENUM(‘true’, ‘false’)

I wanted to change to “true”

But this doesn’t work

SELECT * FROM item WHERE tags contains 'photo' UPDATE cached_on_disk SET cached_on_disk = ‘true’

I want to handle what’s in /assets (or whatever folder) that comes with a download into instead of going to https://. There is a big upgrade to what the size of a App can be. Both at https://play.google.com and App Store in iOS/Apple. (version 1.8) (edited)

soapdog commented 3 years ago

Swami, if you run that query then every single record will appear as cached on this. That query is wrong.

Also, SQLite doesn't have enum types. You can't make a column enum on SQLite, that is why it is set to type text and has a default value of false, which is correct. Please don't alter the database schema, there is no reason to do it. That schema was built with care and is working.


This issue is badly described. I'm not sure what the issue is, and what action should I take. The column cached_on_disk should default to false which is already the case. It can't default to true which is what that query is doing.

SQLite has no enums.

Please, rephrase the issue with a clearer explanation.

Brahmanathaswami commented 3 years ago

Andre, this has nothing to do with SQLite. It has to do with my logging into the dBase:

http://wiki.hindu.org/ganesha-gateway/sql.php?server=1&db=jnanam&table=item&pos=0

  1. go table "item"
  2. hit "SQL"
  3. it a simple question. But for "life of me" I could not find it in a web search
2021-05-04_17-15-09
soapdog commented 3 years ago

Swami,

If it is not related to SQLite, then are you sure this is the right repository for this issue?


Now, to find which items have cached_on_disk set to true on MySQL, you use:

SELECT * FROM `item` WHERE `cached_on_disk` like "true" 

But be aware that that query makes no sense whatsoever for the server since we're not updating that field on the server. The server has the files. If you update that field on the server, it means that when the SQLite for Siva Siva app is generated, then all cached_on_disk will be marked as true for the new export.

That field has been placed on the server just to make sure the export for Siva Siva app contained it and was set to false.

soapdog commented 3 years ago

Don't set that field on the server to true.

That field is only used by Siva Siva app.