I have implemented the ability to start with an empty database or initialize missing tables in an existing database.
- Added
INITIAL_SCHEMAconstant containing the SQL definitions forbregunice,naturalist, andshumsketables.
- Added
initializeDatabasefunction to:- Execute
INITIAL_SCHEMAto create main tables if they don't exist. - Create
app_import_historyandapp_configtables. - Initialize default mappings.
- Execute
- Updated
handleFileUploadto useinitializeDatabase. - Added
handleCreateEmptyDbto create a new in-memory database and initialize it. - Added "Započni sa Praznom Bazom" button to the landing screen.
- None (this is a UI/Logic change).
- Start with Empty Database:
- Open the app.
- Click "Započni sa Praznom Bazom".
- Verify that the dashboard loads.
- Go to "Baza" tab and check that
shumske,bregunice,naturalisttables exist.
- Load Existing Database:
- Load a database file.
- Verify that if tables were missing, they are now created.