AtulDwivedi/ors

Drop table if needed

Closed this issue · 1 comments

If tables are already existing and need to be deleted while deploying the application in order to simulate client like application start-up process then drop the existing tables.

  • Have a context param in web.xml
  • Read it in ContextListener
  • If tables need to be dropped as per the parameter, have a method in SchemaDaoImpl to drop the tables

Tables to be dropped must be application table
Dropping should happen before table creation

  • Added context param in web.xml
  • Reading the same in ContextListener and calling SchemaDaoImpl.dropTables
  • In SchemaDaoImpl.dropTables
    -- Fetching all DB tables
    -- Application tables from h2.sql file
    -- If application table exists in DB then dropping the same