Class SchemaVersion

    • Field Detail

    • Constructor Detail

      • SchemaVersion

        protected SchemaVersion​(com.google.inject.Provider<? extends SchemaVersion> prior)
    • Method Detail

      • getBinaryVersion

        public static int getBinaryVersion()
      • guessVersion

        public static int guessVersion​(Class<?> c)
      • preUpdateSchema

        protected void preUpdateSchema​(ReviewDb db)
                                throws com.google.gwtorm.server.OrmException,
                                       SQLException
        Invoked before updateSchema adds new columns/tables.
        Parameters:
        db - open database handle.
        Throws:
        com.google.gwtorm.server.OrmException - if a Gerrit-specific exception occurred.
        SQLException - if an underlying SQL exception occurred.
      • migrateData

        protected void migrateData​(ReviewDb db,
                                   UpdateUI ui)
                            throws com.google.gwtorm.server.OrmException,
                                   SQLException
        Invoked between updateSchema (adds new columns/tables) and pruneSchema (removes deleted columns/tables).
        Parameters:
        db - open database handle.
        ui - interface for interacting with the user.
        Throws:
        com.google.gwtorm.server.OrmException - if a Gerrit-specific exception occurred.
        SQLException - if an underlying SQL exception occurred.
      • finish

        protected void finish​(CurrentSchemaVersion curr,
                              ReviewDb db)
                       throws com.google.gwtorm.server.OrmException
        Mark the current schema version.
        Throws:
        com.google.gwtorm.server.OrmException
      • renameTable

        protected static void renameTable​(ReviewDb db,
                                          String from,
                                          String to)
                                   throws com.google.gwtorm.server.OrmException
        Rename an existing table.
        Throws:
        com.google.gwtorm.server.OrmException
      • renameColumn

        protected static void renameColumn​(ReviewDb db,
                                           String table,
                                           String from,
                                           String to)
                                    throws com.google.gwtorm.server.OrmException
        Rename an existing column.
        Throws:
        com.google.gwtorm.server.OrmException
      • newExecutor

        protected static com.google.gwtorm.jdbc.JdbcExecutor newExecutor​(ReviewDb db)
                                                                  throws com.google.gwtorm.server.OrmException
        Open a new statement executor.
        Throws:
        com.google.gwtorm.server.OrmException