mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	models: Migration of Message.pub_date to date_sent, part 2.
Fixes #1727. With the server down, apply migrations 0245 and 0246. 0246 will remove the pub_date column, so it's essential that the previous migrations ran correctly to copy data before running this.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							f198475281
						
					
				
				
					commit
					dbe508bb91
				
			@@ -230,7 +230,7 @@ class MessageDict:
 | 
			
		||||
            edit_history = message.edit_history,
 | 
			
		||||
            content = message.content,
 | 
			
		||||
            topic_name = message.topic_name(),
 | 
			
		||||
            pub_date = message.pub_date,
 | 
			
		||||
            date_sent = message.date_sent,
 | 
			
		||||
            rendered_content = message.rendered_content,
 | 
			
		||||
            rendered_content_version = message.rendered_content_version,
 | 
			
		||||
            sender_id = message.sender.id,
 | 
			
		||||
@@ -250,7 +250,7 @@ class MessageDict:
 | 
			
		||||
        fields = [
 | 
			
		||||
            'id',
 | 
			
		||||
            DB_TOPIC_NAME,
 | 
			
		||||
            'pub_date',
 | 
			
		||||
            'date_sent',
 | 
			
		||||
            'last_edit_time',
 | 
			
		||||
            'edit_history',
 | 
			
		||||
            'content',
 | 
			
		||||
@@ -284,7 +284,7 @@ class MessageDict:
 | 
			
		||||
            edit_history = row['edit_history'],
 | 
			
		||||
            content = row['content'],
 | 
			
		||||
            topic_name = row[DB_TOPIC_NAME],
 | 
			
		||||
            pub_date = row['pub_date'],
 | 
			
		||||
            date_sent = row['date_sent'],
 | 
			
		||||
            rendered_content = row['rendered_content'],
 | 
			
		||||
            rendered_content_version = row['rendered_content_version'],
 | 
			
		||||
            sender_id = row['sender_id'],
 | 
			
		||||
@@ -305,7 +305,7 @@ class MessageDict:
 | 
			
		||||
            edit_history: Optional[str],
 | 
			
		||||
            content: str,
 | 
			
		||||
            topic_name: str,
 | 
			
		||||
            pub_date: datetime.datetime,
 | 
			
		||||
            date_sent: datetime.datetime,
 | 
			
		||||
            rendered_content: Optional[str],
 | 
			
		||||
            rendered_content_version: Optional[int],
 | 
			
		||||
            sender_id: int,
 | 
			
		||||
@@ -325,7 +325,7 @@ class MessageDict:
 | 
			
		||||
            recipient_type_id = recipient_type_id,
 | 
			
		||||
            recipient_type    = recipient_type,
 | 
			
		||||
            recipient_id      = recipient_id,
 | 
			
		||||
            timestamp         = datetime_to_timestamp(pub_date),
 | 
			
		||||
            timestamp         = datetime_to_timestamp(date_sent),
 | 
			
		||||
            client            = sending_client_name)
 | 
			
		||||
 | 
			
		||||
        obj[TOPIC_NAME] = topic_name
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user