- updater/migrations/0001_feature_ui_tables.sql: legt voucher_templates und password_reset_tokens idempotent an (CREATE TABLE IF NOT EXISTS), damit bestehende Installationen die neuen Tabellen per System-Update erhalten - Updater-UI: Button "Ausstehende Migrationen ausführen" + run_migrations-Action (CSRF-geschützt) im Migrations-Tab - README: Features (Bulk, Templates, Dark Mode, i18n, Audit-Log, Passwort-Reset), zwei neue Screenshots (Bulk-Erstellung, Dashboard Dark Mode), Roadmap & Updater- Abschnitt aktualisiert
29 lines
1.2 KiB
SQL
29 lines
1.2 KiB
SQL
-- Updater-Migration: Tabellen der UI/Feature-Erweiterung fuer bestehende
|
||
-- Installationen nachziehen (Voucher-Templates + Password-Reset-Tokens).
|
||
-- Idempotent (CREATE TABLE IF NOT EXISTS) – auf frischen Installationen, die
|
||
-- database.sql bereits enthalten, ein No-Op.
|
||
|
||
CREATE TABLE IF NOT EXISTS `voucher_templates` (
|
||
`id` INT PRIMARY KEY AUTO_INCREMENT,
|
||
`name` VARCHAR(255) NOT NULL,
|
||
`max_uses` INT NOT NULL DEFAULT 1,
|
||
`expire_minutes` INT NOT NULL DEFAULT 480,
|
||
`description` VARCHAR(500),
|
||
`is_active` TINYINT(1) DEFAULT 1,
|
||
`created_by` INT,
|
||
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||
FOREIGN KEY (`created_by`) REFERENCES `users`(`id`) ON DELETE SET NULL
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||
|
||
CREATE TABLE IF NOT EXISTS `password_reset_tokens` (
|
||
`id` INT PRIMARY KEY AUTO_INCREMENT,
|
||
`user_id` INT NOT NULL,
|
||
`token` VARCHAR(128) NOT NULL,
|
||
`expires_at` TIMESTAMP NOT NULL,
|
||
`used` TINYINT(1) DEFAULT 0,
|
||
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE,
|
||
UNIQUE KEY `unique_token` (`token`),
|
||
INDEX `idx_expires` (`expires_at`)
|
||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|