Skip to content
This repository has been archived by the owner on Jun 4, 2020. It is now read-only.

Commit

Permalink
Merge branch 'GISeHealth-issue6_fix_spatialite_4.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
vmora committed Aug 11, 2015
2 parents 2e54a87 + 248f645 commit aeade6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Binary file modified test/issue287_wc.sqlite
Binary file not shown.
12 changes: 6 additions & 6 deletions versioning_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ def checkout(pg_conn_info, pg_table_names, sqlite_filename):
if 'GEOMETRY' in cols:
scur.execute("INSERT INTO views_geometry_columns "
"(view_name, view_geometry, view_rowid, "
"f_table_name, f_geometry_column) "
"VALUES"+"('"+table+"_view', 'GEOMETRY', 'ROWID', '"
+table+"', 'GEOMETRY')")
"f_table_name, f_geometry_column, read_only) "
"VALUES"+"('"+table+"_view', 'geometry', 'rowid', '"
+table+"', 'geometry', 0)")

# when we edit something old, we insert and update parent
scur.execute(
Expand Down Expand Up @@ -572,7 +572,7 @@ def update(sqlite_filename, pg_conn_info):
"'"+table+"_conflicts', 'GEOMETRY', "
"(SELECT srid FROM geometry_columns "
"WHERE f_table_name='"+table+"'), "
"(SELECT type FROM geometry_columns "
"(SELECT geometry_type FROM geometry_columns "
"WHERE f_table_name='"+table+"'), 'XY')")

scur.execute("CREATE UNIQUE INDEX IF NOT EXISTS "
Expand Down Expand Up @@ -708,12 +708,12 @@ def commit(sqlite_filename, commit_msg, pg_conn_info):
[sql] = scur.fetchone()
sql = unicode.replace(sql, table, table+"_diff", 1)
scur.execute(sql)
geom = sql.find('GEOMETRY') != -1
geom = (sql.find('GEOMETRY') != -1)
scur.execute("DELETE FROM geometry_columns "
"WHERE f_table_name = '"+table+"_diff'")
if geom:
scur.execute("INSERT INTO geometry_columns "
"SELECT '"+table+"_diff', 'GEOMETRY', type, "
"SELECT '"+table+"_diff', 'geometry', geometry_type, "
"coord_dimension, srid, spatial_index_enabled "
"FROM geometry_columns WHERE f_table_name = '"+table+"'")
scur.execute( "INSERT INTO "+table+"_diff "
Expand Down

0 comments on commit aeade6b

Please sign in to comment.