Rename _vovw_count to _feature_count

This commit is contained in:
Carla Iriberri 2016-04-14 18:23:09 +02:00
parent c595e45c11
commit fd14750ce5

View File

@ -510,8 +510,8 @@ BEGIN
CASE column_type CASE column_type
WHEN 'double precision', 'real', 'integer', 'bigint', 'numeric' THEN WHEN 'double precision', 'real', 'integer', 'bigint', 'numeric' THEN
IF column_name = '_vovw_count' THEN IF column_name = '_feature_count' THEN
RETURN 'SUM(_vovw_count)'; RETURN 'SUM(_feature_count)';
ELSE ELSE
RETURN Format('AVG(%s)::' || column_type, qualified_column); RETURN Format('AVG(%s)::' || column_type, qualified_column);
END IF; END IF;
@ -652,8 +652,8 @@ AS $$
SELECT * FROM cols SELECT * FROM cols
) AS s INTO columns; ) AS s INTO columns;
IF NOT columns LIKE '%_vovw_count%' THEN IF NOT columns LIKE '%_feature_count%' THEN
columns := columns || ', n AS _vovw_count'; columns := columns || ', n AS _feature_count';
END IF; END IF;
EXECUTE Format('DROP TABLE IF EXISTS %I.%I CASCADE;', schema_name, overview_rel); EXECUTE Format('DROP TABLE IF EXISTS %I.%I CASCADE;', schema_name, overview_rel);
@ -746,11 +746,11 @@ BEGIN
IF overview_tables IS NOT NULL AND array_length(overview_tables, 1) > 0 THEN IF overview_tables IS NOT NULL AND array_length(overview_tables, 1) > 0 THEN
SELECT EXISTS ( SELECT EXISTS (
SELECT * FROM CDB_ColumnNames(reloid) as colname WHERE colname = '_vovw_count' SELECT * FROM CDB_ColumnNames(reloid) as colname WHERE colname = '_feature_count'
) INTO has_counter_column; ) INTO has_counter_column;
IF NOT has_counter_column THEN IF NOT has_counter_column THEN
EXECUTE Format(' EXECUTE Format('
ALTER TABLE %s ADD COLUMN _vovw_count integer DEFAULT 1; ALTER TABLE %s ADD COLUMN _feature_count integer DEFAULT 1;
', reloid); ', reloid);
END IF; END IF;
END IF; END IF;