Move RESERVED_COLUMN_NAMES to Sanitize

pull/7250/head
Guido Fioravantti 9 years ago
parent f53013b397
commit b9418ee869

@ -18,8 +18,6 @@ module CartoDB
SURROGATE_NAMESPACE_PUBLIC_PAGES = 'rp'
SURROGATE_NAMESPACE_VIZJSON = 'rj'
RESERVED_COLUMN_NAMES = %W{ FORMAT CONTROLLER ACTION oid tableoid xmin cmin xmax cmax ctid ogc_fid }
LAST_BLOG_POSTS_FILE_PATH = "#{Rails.root}/public/system/last_blog_posts.html"
# Helper method to encapsulate Rails full URL generation compatible with our subdomainless mode

@ -10,17 +10,18 @@ module Carto
DISALLOWED_STARTING_CHARACTERS_REGEX = /^[^a-z]+/
DISALLOWED_CHARACTERS_REGEX = /[^a-z|_|0-9]/
REPEATED_UNDERSCORES_REGEX = /_{2,}/
RESERVED_WORDS = %w(all analyse analyze and any array as asc asymmetric authorization between binary both case
cast check collate column constraint create cross current_date current_role current_time
current_timestamp current_user default deferrable desc distinct do else end except false for
foreign freeze from full grant group having ilike in initially inner intersect into is isnull
join leading left like limit localtime localtimestamp natural new not notnull null off offset
old on only or order outer overlaps placing primary references right select session_user
similar some symmetric table then to trailing true union unique user using verbose when where
xmin xmax).freeze
SYSTEM_TABLE_NAMES = %w(spatial_ref_sys geography_columns geometry_columns raster_columns raster_overviews
cdb_tablemetadata geometry raster).freeze
RESERVED_TABLE_NAMES = %w{ layergroup all public }.freeze
SYSTEM_TABLE_NAMES = %w(spatial_ref_sys geography_columns geometry_columns raster_columns raster_overviews
cdb_tablemetadata geometry raster).freeze
RESERVED_TABLE_NAMES = %w(layergroup all public).freeze
RESERVED_COLUMN_NAMES = %w(format controller action oid tableoid xmin cmin xmax cmax ctid ogc_fid).freeze
RESERVED_WORDS = %w(all analyse analyze and any array as asc asymmetric authorization between binary both
case cast check collate column constraint create cross current_date current_role
current_time current_timestamp current_user default deferrable desc distinct do else
end except false for foreign freeze from full grant group having ilike in initially
inner intersect into is isnull join leading left like limit localtime localtimestamp
natural new not notnull null off offset old on only or order outer overlaps placing
primary references right select session_user similar some symmetric table then to
trailing true union unique user using verbose when where xmin xmax).freeze
def self.append_with_truncate_and_sanitize(identifier, suffix)
suffix_length = suffix.length

Loading…
Cancel
Save