PatchInputModalities.java 970 B

12345678910111213141516171819202122
  1. import java.sql.*;
  2. public class PatchInputModalities {
  3. public static void main(String[] a) throws Exception {
  4. Class.forName("com.mysql.cj.jdbc.Driver");
  5. String jdbc = "jdbc:mysql://cq-cdb-8fjmemkb.sql.tencentcdb.com:27220/fs_tenant_cs1"
  6. + "?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8";
  7. try (Connection c = DriverManager.getConnection(jdbc, "root", "Ylrz_1q2w3e4r5t6y");
  8. Statement st = c.createStatement()) {
  9. try {
  10. st.execute("ALTER TABLE admin_ai_model ADD COLUMN input_modalities VARCHAR(255) NULL");
  11. System.out.println("added input_modalities");
  12. } catch (SQLException e) {
  13. if (e.getMessage() != null && e.getMessage().contains("Duplicate column")) {
  14. System.out.println("column already exists");
  15. } else {
  16. throw e;
  17. }
  18. }
  19. }
  20. }
  21. }