mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	This avoids doing a bunch of extra work, including a downtime-risky `CREATE INDEX` without CONCURRENTLY, when migrating a modern Zulip system to PGroonga the first time.
		
			
				
	
	
		
			22 lines
		
	
	
		
			616 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			616 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from django.conf import settings
 | 
						|
from django.db import migrations
 | 
						|
 | 
						|
 | 
						|
class Migration(migrations.Migration):
 | 
						|
 | 
						|
    dependencies = [
 | 
						|
        ("zerver", "0001_initial"),
 | 
						|
    ]
 | 
						|
 | 
						|
    database_setting = settings.DATABASES["default"]
 | 
						|
 | 
						|
    operations = [
 | 
						|
        # This previously had additional operations, but they are all
 | 
						|
        # undone in migration 0003 because we switched to using the
 | 
						|
        # PGroonga v2 API.
 | 
						|
        migrations.RunSQL(
 | 
						|
            sql="ALTER TABLE zerver_message ADD COLUMN search_pgroonga text;",
 | 
						|
            reverse_sql="ALTER TABLE zerver_message DROP COLUMN search_pgroonga;",
 | 
						|
        ),
 | 
						|
    ]
 |