fix warnings and remove old migrations
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e33a734199
commit
9510d9c765
13
Cargo.lock
generated
13
Cargo.lock
generated
@ -294,18 +294,6 @@ dependencies = [
|
|||||||
"mime",
|
"mime",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "axum-macros"
|
|
||||||
version = "0.2.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6293dae2ec708e679da6736e857cf8532886ef258e92930f38279c12641628b8"
|
|
||||||
dependencies = [
|
|
||||||
"heck 0.4.0",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bae"
|
name = "bae"
|
||||||
version = "0.1.7"
|
version = "0.1.7"
|
||||||
@ -1176,7 +1164,6 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"axum",
|
"axum",
|
||||||
"axum-macros",
|
|
||||||
"http",
|
"http",
|
||||||
"neo-entity",
|
"neo-entity",
|
||||||
"neo-migration",
|
"neo-migration",
|
||||||
|
@ -16,7 +16,6 @@ thiserror = "1.0"
|
|||||||
rand = { version = "0.8.5", features = ["std"] }
|
rand = { version = "0.8.5", features = ["std"] }
|
||||||
uuid = { version = "1.0", features = ["v4"] }
|
uuid = { version = "1.0", features = ["v4"] }
|
||||||
ruma = { version = "0.6.4", features = ["client-api", "compat"] }
|
ruma = { version = "0.6.4", features = ["client-api", "compat"] }
|
||||||
axum-macros = "0.2.2"
|
|
||||||
http = "0.2.8"
|
http = "0.2.8"
|
||||||
sea-orm = { version = "^0.8", features = ["sqlx-sqlite", "runtime-tokio-native-tls", "macros"], default-features = false }
|
sea-orm = { version = "^0.8", features = ["sqlx-sqlite", "runtime-tokio-native-tls", "macros"], default-features = false }
|
||||||
neo-entity = { version = "*", path = "../neo-entity" }
|
neo-entity = { version = "*", path = "../neo-entity" }
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
-- Add migration script here
|
|
||||||
CREATE TABLE users(
|
|
||||||
uuid TEXT PRIMARY KEY NOT NULL,
|
|
||||||
user_id CHAR(255) NOT NULL,
|
|
||||||
display_name TEXT NOT NULL,
|
|
||||||
password_hash TEXT NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE INDEX user_id_index ON users (user_id);
|
|
@ -1,11 +0,0 @@
|
|||||||
-- Add migration script here
|
|
||||||
|
|
||||||
CREATE TABLE devices(
|
|
||||||
uuid TEXT PRIMARY KEY NOT NULL,
|
|
||||||
user_uuid INT NOT NULL,
|
|
||||||
device_id TEXT NOT NULL,
|
|
||||||
display_name TEXT NOT NULL,
|
|
||||||
FOREIGN KEY(user_uuid) REFERENCES users(uuid)
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE INDEX device_id_index ON devices (device_id);
|
|
@ -1,10 +0,0 @@
|
|||||||
-- Add migration script here
|
|
||||||
|
|
||||||
CREATE TABLE sessions(
|
|
||||||
uuid TEXT PRIMARY KEY NOT NULL,
|
|
||||||
device_uuid INT NOT NULL,
|
|
||||||
key TEXT NOT NULL,
|
|
||||||
FOREIGN KEY(device_uuid) REFERENCES devices(uuid)
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE INDEX key_index ON sessions (key);
|
|
@ -1,8 +0,0 @@
|
|||||||
-- Add migration script here
|
|
||||||
|
|
||||||
CREATE TABLE rooms(
|
|
||||||
uuid TEXT PRIMARY KEY NOT NULL,
|
|
||||||
name TEXT NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE UNIQUE INDEX name_index ON rooms(name);
|
|
@ -1,13 +0,0 @@
|
|||||||
-- Add migration script here
|
|
||||||
|
|
||||||
CREATE TABLE events(
|
|
||||||
uuid TEXT PRIMARY KEY NOT NULL,
|
|
||||||
room_uuid TEXT NOT NULL,
|
|
||||||
type TEXT NOT NULL,
|
|
||||||
state_key TEXT,
|
|
||||||
sender_uuid TEXT NOT NULL,
|
|
||||||
origin_server_ts INT NOT NULL,
|
|
||||||
content TEXT NOT NULL,
|
|
||||||
FOREIGN KEY(room_uuid) REFERENCES rooms(uuid),
|
|
||||||
FOREIGN KEY(sender_uuid) REFERENCES users(uuid)
|
|
||||||
);
|
|
@ -19,6 +19,7 @@ macro_rules! map_err {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum ApiError {
|
pub enum ApiError {
|
||||||
#[error("Registration Error")]
|
#[error("Registration Error")]
|
||||||
RegistrationError(#[from] RegistrationError),
|
RegistrationError(#[from] RegistrationError),
|
||||||
@ -74,6 +75,7 @@ impl IntoResponse for ApiError {
|
|||||||
)
|
)
|
||||||
.into_response()
|
.into_response()
|
||||||
}
|
}
|
||||||
|
#[allow(unreachable_patterns)]
|
||||||
_ => StatusCode::INTERNAL_SERVER_ERROR.into_response(),
|
_ => StatusCode::INTERNAL_SERVER_ERROR.into_response(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,9 @@ use crate::types::error_code::ErrorCode;
|
|||||||
|
|
||||||
use super::ErrorResponse;
|
use super::ErrorResponse;
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum AuthenticationError {
|
pub enum AuthenticationError {
|
||||||
#[error("UserId is missing")]
|
#[error("UserId is missing")]
|
||||||
MissingUserId,
|
MissingUserId,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#[allow(unused)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum ErrorCode {
|
pub enum ErrorCode {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user