mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20: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
|
// Init components
|
||||||
let auth = match Auth::new(connection.clone()) {
|
let auth = match Auth::new(connection.clone()) {
|
||||||
Ok(auth) => Rc::new(auth),
|
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 database = Rc::new(Database::new(connection, profile_identity_id.clone()));
|
||||||
let memory = Rc::new(Memory::new());
|
let memory = Rc::new(Memory::new());
|
||||||
|
@ -89,7 +89,7 @@ impl Auth {
|
|||||||
.memory
|
.memory
|
||||||
.add(record.url, record.profile_identity_gemini_id)
|
.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,
|
`url` VARCHAR(1024) NOT NULL,
|
||||||
|
|
||||||
FOREIGN KEY (`profile_identity_gemini_id`) REFERENCES `profile_identity_gemini`(`id`),
|
FOREIGN KEY (`profile_identity_gemini_id`) REFERENCES `profile_identity_gemini`(`id`),
|
||||||
|
UNIQUE (`url`)
|
||||||
UNIQUE (
|
|
||||||
`profile_identity_gemini_id`,
|
|
||||||
`url`
|
|
||||||
)
|
|
||||||
)",
|
)",
|
||||||
[],
|
[],
|
||||||
)
|
)
|
||||||
|
@ -4,5 +4,5 @@ pub enum Error {
|
|||||||
DatabaseRecordCreate(i64, String),
|
DatabaseRecordCreate(i64, String),
|
||||||
DatabaseRecordDelete(i64),
|
DatabaseRecordDelete(i64),
|
||||||
DatabaseRecordsRead(String),
|
DatabaseRecordsRead(String),
|
||||||
Memory(super::memory::Error),
|
MemoryIndex(super::memory::Error),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user