Initial commit of the Asset Management System, including project structure, Docker configuration, database migrations, and core application files. Added user authentication, asset management features, and basic UI components.
This commit is contained in:
19
database/migrations/010_create_inventory_items_table.sql
Normal file
19
database/migrations/010_create_inventory_items_table.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
CREATE TABLE inventory_items (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
inventory_id INT NOT NULL,
|
||||
asset_id INT NOT NULL,
|
||||
soll_status ENUM('aktiv', 'inaktiv', 'ausgemustert') NOT NULL,
|
||||
ist_status ENUM('gefunden', 'nicht_gefunden', 'defekt', 'verschoben') NOT NULL,
|
||||
checked_at TIMESTAMP NULL,
|
||||
checked_by INT,
|
||||
bemerkung TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (inventory_id) REFERENCES inventories(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (asset_id) REFERENCES assets(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (checked_by) REFERENCES users(id) ON DELETE SET NULL,
|
||||
INDEX idx_inventory_id (inventory_id),
|
||||
INDEX idx_asset_id (asset_id),
|
||||
INDEX idx_checked_by (checked_by),
|
||||
INDEX idx_ist_status (ist_status),
|
||||
UNIQUE KEY unique_inventory_asset (inventory_id, asset_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
Reference in New Issue
Block a user