Add new password attempt table

This commit is contained in:
Markus Thielker 2025-01-17 22:21:23 +01:00
parent 61ee809df5
commit 54b1cc1884
No known key found for this signature in database
2 changed files with 29 additions and 1 deletions

View file

@ -0,0 +1,28 @@
//
// PasswordAttempt.swift
// password
//
// Created by Markus Thielker on 17.01.25.
//
import Foundation
import SwiftData
@Model
class PasswordAttempt: Identifiable {
@Attribute(.unique) var id: UUID
var password: UUID
var timestamp: Date
var isSuccessful: Bool
var typingTime: Double
init(id: UUID = UUID(), password: UUID, timestamp: Date = Date(), isSuccessful: Bool, typingTime: Double) {
self.id = id
self.password = password
self.timestamp = timestamp
self.isSuccessful = isSuccessful
self.typingTime = typingTime
}
}

View file

@ -60,7 +60,7 @@ struct passwordApp: App {
authenticate()
}
}
.modelContainer(for: [Password.self])
.modelContainer(for: [Password.self, PasswordAttempt.self])
}
}