You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Annotate is adding us additional indexes to other table with same name but with prefix.
Cause: #405 provided code to remove table_name_prefix on index annotate, as some people have problem with public. prefix @ postgres.
Fixing prefix this way maybe can be valid but is not universal.
We use table_name_prefix for domain module table prefixes like this:
module AccessControlSystems
class BaseModel < ApplicationRecord
self.abstract_class = true
def self.table_name_prefix
'access_control_systems_'
end
end
end
(...)
#
# Indexes
#
# index_locations_on_contact_user_id (contact_user_id) # <<<< it should not be here
#
module AccessControlSystems
class Location < BaseModel
end
end
and we have common location table without table prefix:
(...)
#
# Indexes
#
# index_locations_on_contact_user_id (contact_user_id)
#
# Foreign Keys
# (...) Foreign keys are fine
class Location < ApplicationRecord
end
We can also define table_name_prefix in AccessControlSystems::Location and the issue will be there
Commands
We annotate on migrate:
rake db:migrate
Version
annotate version 4.2.0 (4.1.X)
rails version 5.2.6
ruby version 2.6.9
The text was updated successfully, but these errors were encountered:
Annotate is adding us additional indexes to other table with same name but with prefix.
Cause:
#405 provided code to remove table_name_prefix on index annotate, as some people have problem with
public.
prefix @ postgres.Fixing prefix this way maybe can be valid but is not universal.
We use table_name_prefix for domain module table prefixes like this:
and we have common location table without table prefix:
We can also define table_name_prefix in AccessControlSystems::Location and the issue will be there
Commands
We annotate on migrate:
Version
The text was updated successfully, but these errors were encountered: