File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,7 @@ _310 TILs and counting..._
198198-  [ Retrieve An Object If It Exists] ( rails/retrieve-an-object-if-it-exists.md ) 
199199-  [ Select A Select By Selector] ( rails/select-a-select-by-selector.md ) 
200200-  [ Select Value For SQL Counts] ( rails/select-value-for-sql-counts.md ) 
201+ -  [ Set Schema Search Path] ( rails/set-schema-search-path.md ) 
201202-  [ Show Pending Migrations] ( rails/show-pending-migrations.md ) 
202203-  [ Show Rails Models With Pry] ( rails/show-rails-models-with-pry.md ) 
203204-  [ Show Rails Routes With Pry] ( rails/show-rails-routes-with-pry.md ) 
Original file line number Diff line number Diff line change 1+ # Set Schema Search Path  
2+ 
3+ By default the schema search path for a PostgreSQL database is going to be
4+ ` "$user", public ` . Tables created by a Rails migration are going to end up
5+ on the ` public `  schema by default. If your application has other schemas in
6+ play, then you may want to ensure that those schemas are also on the schema
7+ search path. This can be accomplished by adding the ` schema_search_path ` 
8+ setting to your ` database.yml `  file. For instance, to include both the
9+ ` legacy `  and ` public `  schema in the Postgres search path, add the following
10+ line:
11+ 
12+ ``` ruby 
13+ schema_search_path:  " legacy,public" 
14+ ``` 
15+ 
16+ h/t Jack Christensen
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments