Commit Graph

66 Commits

Author SHA1 Message Date
Sandro Santilli
967b7abec0 Try to retain existing cartodb_id values
Also reset sequence when original cartodb_id values correctly
cast to integers, and does not keep a backup in that case.

Closes #27
2014-05-22 14:11:09 +02:00
Sandro Santilli
134d2d29b6 Try to cast TEXT typed updated_at and created_at if present
If the cast fails we'll still rename those fields and create
new ones. See #27 (cartodb_id is still not done)
2014-05-22 13:10:42 +02:00
Sandro Santilli
0082138503 Do not force DROP FUNCTION but rely on CREATE OR REPLACE
We'll bet on no old signature being left around.

Presence of an old signature would break at runtime
with a message like:
ERROR:  function CDB_UserTables() is not unique

Closes #25
2014-05-20 16:39:18 +02:00
Sandro Santilli
2f0031e6a2 Do not call CDB_Invalidate_Varnish() if not owned by a superuser
Search for that function in schemas cartodb and public (in that order).
Closes #24
2014-05-14 19:03:20 +02:00
Sandro Santilli
8d6188e282 Have _CDB_UserQuotaInBytes() take precedence over parameter-based quota
Closes #16
2014-05-12 13:37:47 +02:00
Sandro Santilli
f98071cdac Do not allow cartodbfying tables while no user quota is set
Closes #17
Updates tests
2014-05-12 13:27:44 +02:00
Sandro Santilli
cfd8dbc5a4 Test calls to CDB_Invalidate_Varnish
Also drops the DELETE trigger on CDB_TableMetadata as the call to
CDB_Invalidate_Varnish would then get an OID, which is pretty useless.
Closes #8
2014-05-09 17:34:18 +02:00
Sandro Santilli
b69ded8f66 Let CDB_CheckQuota second parameter override configured user quota
Closes #13
Includes automated test
2014-05-09 12:55:41 +02:00
Sandro Santilli
30186ac8cb Pretend _CDB_UserQuotaInBytes has to stay in public
Fixes run of the testsuite in the pre-extension model
2014-05-08 17:20:40 +02:00
Sandro Santilli
acf3097c3a Add CDB_SetUserQuotaInBytes function
Closes #2
2014-05-08 17:14:06 +02:00
Sandro Santilli
055efe04aa Do not assume existance of a "publicuser" role in CDB_UserTables
Closes #5 (take 2)
2014-05-08 16:42:38 +02:00
Sandro Santilli
9b6f9e21f2 Stick with user tables being in public
... but workaround extension code replacing "public." with "cartodb."
2014-05-06 10:53:19 +02:00
Sandro Santilli
15740f2ef6 Enable running all tests via "installcheck"
NOTE: also makes CDB_TableMetadata triggers still functional
      when user quota and varnish invalidation functions are missing
      from the database (currently installed by cartodb ruby)
2014-05-06 10:18:38 +02:00
Sandro Santilli
0960276046 Import cartodb/lib/sql/test, add search_path tweaker 2014-05-05 18:48:48 +02:00
Sandro Santilli
5e28417b3d Add "cdb_org_admin" and "cdb_org_user" roles as part of extension 2014-05-05 18:04:14 +02:00
Sandro Santilli
2f1fdf5a15 Copy cartodb lib/sql scripts from CDB_CartodbfyTable branch 2014-05-05 17:13:06 +02:00