You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this need to drop a table I no longer use.
I want to delete all related codes including the class file.
Also I want to drop this table from db during migration because the table might be existed in old versions.
I thought it could be done if I drop using the table name, but I only found these two APIs available to drop a table:
public static <T, ID> int dropTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig, boolean ignoreErrors)
public static <T, ID> int dropTable(ConnectionSource connectionSource, Class<T> dataClass, boolean ignoreErrors)
DatabaseTableConfig also need a class object in its constructor.
So I have to provide the class which declare the table.
Now I have two choices:
Delete the class and let the table left alone in app upgraded from old versions.
Keep the class and drop table. -> the codebase will look strange to keep these codes.
How could I delete the class and drop the table?
The text was updated successfully, but these errors were encountered:
You could always issue the command using raw methods. You can always create a fake class with the matching table name to drop it. I considered adding a dropTable(String) method but the issue is that if you created indexes, they wouldn't be removed. Given that you don't do a createTable(String), having a drop table string seems like bad parity.
I have this need to drop a table I no longer use.
I want to delete all related codes including the class file.
Also I want to drop this table from db during migration because the table might be existed in old versions.
I thought it could be done if I drop using the table name, but I only found these two APIs available to drop a table:
DatabaseTableConfig
also need a class object in its constructor.So I have to provide the class which declare the table.
Now I have two choices:
How could I delete the class and drop the table?
The text was updated successfully, but these errors were encountered: