File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -82,16 +82,19 @@ public function it_respects_table_prefixes()
8282        $ originalPrefix$ connectiongetTablePrefix ();
8383
8484        try  {
85-             // Drop existing tables first 
85+             // Set prefix FIRST before creating tables 
86+             $ connectionsetTablePrefix ('prefix_ ' );
87+             
88+             // Drop existing unprefixed tables 
89+             $ connectionsetTablePrefix ($ originalPrefix
8690            Schema::dropIfExists ('posts ' );
8791            Schema::dropIfExists ('videos ' );
8892            Schema::dropIfExists ('comments ' );
8993            Schema::dropIfExists ('blogs ' );
9094            Schema::dropIfExists ('pages ' );
91- 
92-             // Set prefix and create prefixed tables 
93-             $ connectionsetTablePrefix ('prefix_ ' );
9495
96+             // Set prefix back and create prefixed tables 
97+             $ connectionsetTablePrefix ('prefix_ ' );
9598            include_once  __DIR__  . '/create_tables.php ' ;
9699            (new  \CreateTables )->up ();
97100
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments