mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 09:10:08 +00:00
fix unique key for auth
This commit is contained in:
parent
59e9739142
commit
cadefe3f1d
@ -34,7 +34,7 @@ impl Gemini {
|
||||
// Init components
|
||||
let auth = match Auth::new(connection.clone()) {
|
||||
Ok(auth) => Rc::new(auth),
|
||||
Err(reason) => return Err(Error::AuthInit(reason)), // @TODO
|
||||
Err(reason) => return Err(Error::AuthInit(reason)),
|
||||
};
|
||||
let database = Rc::new(Database::new(connection, profile_identity_id.clone()));
|
||||
let memory = Rc::new(Memory::new());
|
||||
|
@ -89,7 +89,7 @@ impl Auth {
|
||||
.memory
|
||||
.add(record.url, record.profile_identity_gemini_id)
|
||||
{
|
||||
return Err(Error::Memory(reason));
|
||||
return Err(Error::MemoryIndex(reason));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,11 +78,7 @@ pub fn init(tx: &Transaction) -> Result<usize, Error> {
|
||||
`url` VARCHAR(1024) NOT NULL,
|
||||
|
||||
FOREIGN KEY (`profile_identity_gemini_id`) REFERENCES `profile_identity_gemini`(`id`),
|
||||
|
||||
UNIQUE (
|
||||
`profile_identity_gemini_id`,
|
||||
`url`
|
||||
)
|
||||
UNIQUE (`url`)
|
||||
)",
|
||||
[],
|
||||
)
|
||||
|
@ -4,5 +4,5 @@ pub enum Error {
|
||||
DatabaseRecordCreate(i64, String),
|
||||
DatabaseRecordDelete(i64),
|
||||
DatabaseRecordsRead(String),
|
||||
Memory(super::memory::Error),
|
||||
MemoryIndex(super::memory::Error),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user