bmc_hub/migrations/076_nextcloud_instances.sql
Christian 56d6d45aa2 feat(sag): Add Varekøb & Salg module with database migration and frontend template
- Created a new SQL migration for the sag_salgsvarer table to manage sales and purchase items.
- Implemented a new HTML template for the Varekøb & Salg module, including summary cards and tables for sales and purchases.
- Added JavaScript functions for loading and rendering order data dynamically.
- Introduced a new backend search module for customers, contacts, hardware, and locations with autocomplete functionality.
- Developed an email templates API for managing system and customer-specific email templates.
- Created multiple migrations for Nextcloud instances, cache, audit logs, email templates, sag comments, hardware locations, and billing methods.
- Enhanced the sag module with solutions, order lines, work types, and 2FA support for user authentication.
2026-02-02 20:23:56 +01:00

23 lines
743 B
SQL

-- Migration: 076_nextcloud_instances
-- Created: 2026-02-01
CREATE TABLE IF NOT EXISTS nextcloud_instances (
id SERIAL PRIMARY KEY,
customer_id INTEGER NOT NULL REFERENCES customers(id) ON DELETE CASCADE,
base_url TEXT NOT NULL,
auth_type VARCHAR(20) NOT NULL DEFAULT 'basic',
username TEXT NOT NULL,
password_encrypted TEXT NOT NULL,
is_enabled BOOLEAN NOT NULL DEFAULT true,
disabled_at TIMESTAMP,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
deleted_at TIMESTAMP
);
CREATE UNIQUE INDEX IF NOT EXISTS idx_nextcloud_instances_customer
ON nextcloud_instances(customer_id);
CREATE INDEX IF NOT EXISTS idx_nextcloud_instances_enabled
ON nextcloud_instances(is_enabled);