Add existence checks to older migrations (002, 004, 013, 021, 031, 034, 044,
046, 071, 086, 087) to prevent errors when objects already exist.
Also fixes syntax errors in migrations 046 and 086 where index creation
code was incorrectly placed outside try/except blocks.
All affected migrations now:
- Check for table/column/index existence before creating
- Handle existing objects gracefully with informative messages
- Have safe downgrade functions
- Use proper try/except error handling
Add existence checks to recent migrations (032, 049, 053, 055, 058, 064, 099)
to prevent DuplicateTable and DuplicateColumn errors. These migrations now:
- Check if tables/columns exist before creating them
- Handle cases where objects already exist gracefully
- Provide informative messages about operations
- Have safe downgrade functions with existence checks
This makes migrations more resilient to partial failures and manual
schema changes.
Fix migration 098 to check if invoice_peppol_transmissions table exists
before creating it. This prevents DuplicateTable errors when the migration
is run on databases where the table was already created manually or
during a previous partial migration attempt.
The migration now:
- Checks for table existence before creating
- Handles existing tables gracefully
- Provides informative messages
- Has safe downgrade function
- Update translation files for Arabic, German, English, Spanish
- Update Finnish, French, Hebrew, Italian translations
- Update Norwegian (nb/no) and Dutch translations
- Sync translations across all language files
- Update stock movement model with improved functionality
- Enhance inventory routes and API endpoints
- Improve inventory templates for movements, reports, and stock items
- Add better history tracking and valuation reporting
Add Peppol BIS Billing 3.0 (UBL) invoice sending via a configurable access point, including admin-configurable settings, per-invoice send history, and documentation/README updates.
Also introduce stock lots/allocations (valuation layers) with supporting inventory route/report/UI updates and hardened startup migration handling.
Some legacy/partially-upgraded databases already have one or more integration OAuth columns in settings (e.g. google_calendar_client_id). Only add missing columns and set defaults for columns that exist so upgrades don't fail with DuplicateColumn.
Bump version to 4.8.12.
Avoid DuplicateTable/duplicate index errors on partially-migrated databases by skipping creation of existing template tables (quote_templates, project_templates, time_entry_templates) and only creating missing indexes/columns.
Also bump version to 4.8.11.
Prevent Postgres upgrades from failing when alembic_version.version_num is too small for long revision IDs, and add an alias migration to bridge older installs that recorded '067_add_integration_credentials'.
Add new client portal pages (dashboard, approvals, notifications, documents, reports) and extend API/routes/services to support client approvals, invoices/quotes views, and related notifications.
Update email templates and docs; add/adjust tests for new models/routes.
- Rename 'metadata' column to 'extra_data' in ClientNotification model
to avoid SQLAlchemy Declarative API reserved word conflict
- Update ClientNotificationService to use 'extra_data' instead of 'metadata'
- Maintain API compatibility by returning 'metadata' key in to_dict() method
- Update migration to create 'extra_data' column instead of 'metadata'
- Improve migration idempotency and SQLite compatibility with proper checks
- Enhance backup directory handling with configurable BACKUP_FOLDER support
- Update admin routes to use centralized backup directory function
This fixes the application startup error:
sqlalchemy.exc.InvalidRequestError: Attribute name 'metadata' is reserved
when using the Declarative API.
The migration is now idempotent and handles both PostgreSQL and SQLite
databases safely.
Default admin backups to a writable, configurable folder (BACKUP_FOLDER/BACKUP_DIR, defaulting to /data/uploads/backups) to avoid permission denied errors in non-root containers.
Also update local-test compose and docs to reflect the backup location.
The migration was failing with DuplicateTable error when the table
already existed in the database. This can happen when:
- The table was created manually
- A previous migration attempt partially succeeded
- Database state is out of sync with Alembic version tracking
Changes:
- Add _has_table() helper to check table existence
- Add _has_index() helper to check index existence
- Make upgrade() idempotent by checking before creating
- Make downgrade() safe by checking before dropping
- Follow same pattern as other migrations (018, 037)
This allows the migration to run successfully even when the table
already exists, creating only missing indexes if needed.
- Refactor migrations with idempotency checks and better error handling
* Add SQLAlchemy inspector checks for table/column existence
* Improve error messages and handling for schema operations
* Make migrations safe to run multiple times
* Update 27 migration files with enhanced error handling patterns
- Add missing schema columns via new migrations
* Migration 095: Add ui_show_issues column to users table
* Migration 096: Add portal_issues_enabled column to clients table
- Enhance Settings model error handling
* Improve detection of schema errors (table/column missing)
* Better handling of SQLAlchemy exceptions during migrations
* More comprehensive error checking for OperationalErrors
- Fix database auto-switching logic in app initialization
* Respect explicit DATABASE_URL setting to prevent unwanted switches
* Only auto-switch to PostgreSQL when not explicitly configured
- Update docker entrypoint script with migration improvements
- Replace bg-white dark:bg-gray-800 with bg-card-light dark:bg-card-dark across all templates for consistent theming
- Fix layout rendering issues on multiple pages:
* Calendar - Calendar View
* Time Tracking - Projects, Weekly Goals, Time Entry Templates
* Tools & Data - Import/Export, Saved Filters
* Admin - Security Access (API Tokens), System Maintenance (Backups)
* User pages (Profile, Settings)
* Invoice, Quote, and Expense pages
* All component widgets and help pages
- Remove footer section from base.html to clean up page layout
- Remove unused footer script for setting current year
- Ensure consistent card styling across entire application for proper dark mode support
Affects 33 template files total.
- Add dedicated donation page (/donate) explaining why donations matter
- Implement DonationInteraction model to track user engagement and interactions
- Add smart banner logic with contextual messaging based on user milestones
- Improve donation accessibility with links in sidebar, footer, dashboard, and all major pages
- Add UTM tracking to all Buy Me a Coffee links for analytics
- Fix CSRF token issues in donation tracking JavaScript
- Enhance dashboard widget with user stats and dual action buttons
- Add donation information section to About page
- Update support banner with 'Learn More' and 'Donate' options
- Create database migration for donation_interactions table
The donation system now provides:
- Smart prompts that show after user milestones (7+ days, 50+ entries, 100+ hours)
- Banner dismissal tracking with 30-day cooldown
- Multiple access points throughout the application
- Better visibility of donation impact and importance
- Comprehensive tracking for analytics and optimization
- Fix tasks not being created when projects are created from templates
* Remove invalid status parameter from task creation (TaskService doesn't accept it)
* Fix estimated_hours conversion from string to float/None
* Add proper error handling for task creation failures
* Refresh template from database before reading tasks
- Fix missing tasks section in template edit form
* Add tasks section to edit template form with full CRUD functionality
* Display existing tasks when editing templates
* Allow adding, editing, and removing tasks in templates
- Fix tasks not being saved when creating/editing templates
* Fix JavaScript form handling to properly collect tasks from form
* Create tasks input field on page load and update on submit
* Add capture phase event listener to ensure tasks are set before form submission
* Ensure tasks are always saved as a list (never None)
- Fix [object Object] error in toast notifications
* Add safeguards to ensure flash messages are always strings
* Add object-to-string conversion in toast notification system
- Improve error handling and validation
* Add validation to ensure tasks is always a list
* Improve JSON parsing with better error handling
* Add safeguards for flash message handling
Convert None database values to empty strings in template to prevent 'None' text from appearing in form fields. This fixes an issue where users had to manually delete 'None' from URL and other optional fields before saving.
Updated fields: image_url, description, category, barcode, and notes to use 'or' filter for proper None handling.
Convert Supplier objects to dictionaries before passing to template to
prevent 'Object of type Supplier is not JSON serializable' error.
The template uses tojson filter to serialize suppliers for JavaScript,
but SQLAlchemy model objects are not directly JSON serializable. By
converting suppliers to dictionaries using to_dict() method before
rendering, the serialization now works correctly.
Fixes issue where editing stock items resulted in 500 server error.
Affects both new_stock_item and edit_stock_item routes.