weizhouapache commented on code in PR #7414:
URL: https://github.com/apache/cloudstack/pull/7414#discussion_r1160128970


##########
engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql:
##########
@@ -19,3 +19,7 @@
 -- Schema upgrade from 4.18.1.0 to 4.19.0.0
 --;
 
+-- Invalidate existing console_session records
+UPDATE `cloud`.`console_session` SET removed=now();
+-- Modify acquired column in console_session to datetime type
+ALTER TABLE `cloud`.`console_session` MODIFY `acquired` datetime COMMENT 'When 
the session was acquired;

Review Comment:
   - missing ' as last char
   
   - error when execute the sql statement
   ```
   mysql> ALTER TABLE `cloud`.`console_session` MODIFY `acquired` datetime 
COMMENT 'When the session was acquired';
   ERROR 1292 (22007): Incorrect datetime value: '0' for column 'acquired' at 
row 1
   ```
   
   We probably need to remove all records from the table. 
   ```
   mysql> delete from console_session;
   Query OK, 51 rows affected (0.01 sec)
   
   
   mysql> ALTER TABLE `cloud`.`console_session` MODIFY `acquired` datetime 
COMMENT 'When the session was acquired';
   Query OK, 0 rows affected (0.07 sec)
   Records: 0  Duplicates: 0  Warnings: 0
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to